A man who allegedly stalked two South Australian members of parliament has been cautioned, police have revealed.