generally, it's when you ask them to follow you or the conversation leads to them wanting to follow you, but I think the AI has to interpret that as such in the given circumstance. Because of that, sometimes you get, I guess you could call, "false positives" that NPCs need to follow the player and give you the choice then. Since it's up to the AIs interpretation, I don't know if you can reliably predict when it happens, but if you're reasonably convincing enough, it's not hard to force the options to appear in the first place.