How/when should I ask my supervisors' for a reference letter?
Inform them about your plans now and let them decide what works best for them.

You may be right that they will have forgotten you by the time you apply (depending on how much you worked together). But on the other side, the best LORs are specific to a position you are applying for and should be tailor written, "generic" LORs may not be as good, and some people may not want to write one without knowing what they are going to be for.