my guess would be that this is not allowed. the rules for the flagship's ability are written in a pretty clear sequence:
Place one of your ships that is in any surrounding space on top of the flagship. Then use the flagship’s move action to move the flagship 1 or 2 spaces. Finally, place the transported ship in any empty surrounding space.
seems to me that the pickup must take place before the movement begins.