The visa issuance is sponsored by the company to whom you are visiting. Once you leave that company (Flight School in your case) the visa is then null and void and when you want to return to the US to a different flight school, you will need to start the visa process again.
Not entirely true.
SEVIS provide guidance on this and state the only thing required is a new SEVIS fee if the visa is still valid :
Travel | ICE
May I re-establish M-1 student status by obtaining a new initial Form I-20 and re-entering the United States?
Yes, you may re-establish M-1 student status. However, in SEVIS, you will be an Initial student. You must pay the I-901 SEVIS fee, and you will lose any time that you have built up towards qualification for practical training.