The former first minister said had "known in her heart" for a while it is time to step down as an MSP.