Why do my units created pre-optics not get embarkment?

In order for a unit created before Optics is researched to receive the embarkation promotion, it needs to first return to its home territory (doesn't have to be a city; entering your own domain should suffice) or stations itself in one of your allies' city-states. Once there, it can then embark/disembark wherever it wants to.

Interestingly I can't seem to find this in Civpedia, but as Rilgon has mentioned in the comments, it is mentioned by your advisor when you research Optics.