Optimal Low-Thrust Transfers in Two-Body and Three-Body Dynamics