Ships with the Training mission use supplies from the planet they orbit to gain experience.

Experience_added = EPTrainingScale * Points / (Sqrt(Hull_Crew) + 1)
    ...where
       Points = Supplies                    if Supplies ≤ 25
       Points = 25 + Sqrt(8*(Supplies-25))  otherwise

(4.0i) Academy ships receive four times as much experience from training.

See Experience Training for a more detailed explanation of training.