Hanging the legs down, swinging them, standing on the pegs is what I ve done. None safer than the other.
Ideally, stop, get off, walk a few steps, squat, stretch and get back on.
But I find it quite a chore to stop and get off on longer trips and only do it when the fatigue becomes unbearable.