Assuming you refer to a fighter, or one of the freighters specifically listed as being able to do this with, you assign yourself as Pilot, then on the piloted ships tab of your inventory, you set the other ship to being NPC controlled (while you are at the same location it is). Then it should follow you around.
____________
"May the Grace of Ara go with you, and His Vengeance be wrought upon your enemies."