This means the kind of 'legs' you must have in order to stand upright out at sea, on a constantly moving ship. In other words, to "get your bearings" or get used to how things work in a new environment that is unfamiliar to you. The idea is that you have to learn to get 'in sync' with the rhythm of the waves, or you'll end up on your backside : )