Mozart has been musically educated by his father Leopold and was influenced by Johann Christian Bach and Joseph Haydn.
He was trained in studying counterpoint, harmony, chord theory.
It is likely that Mozart studied Fux's work first under the influence of his father ...
http://www.opus28.co.uk/Fux_Gradus.pdf
Fux: Gradus ad Parnassum.
Also see: Haydn - Mozart connection and J.Chr. Bach - Mozart Connection.
The two composers knew each other, defended each other, and learned from each other in ways that shaped their musical output for much of their lives — despite a vast difference in age and temperament.
Perhaps it was the very differences between these two men of genius that drew them to each other. Whatever it was, they drew support and inspiration from one another in ways that profoundly affected their work. If they had not met, neither would have been as productive, and their output far different.
In this hour, the story behind the deep friendship between Joseph Haydn and Wolfgang Amadeus Mozart, and the great music it inspired.
http://www.capradio.org/classical/connections/2014/03/08/connections-030814/
Mozart's Counterpoint: Its Growth and Significance
https://www.jstor.org/stable/727803
https://www.nytimes.com/1988/08/14/arts/music-what-haydn-taught-mozart.html
Mozart’s lifelong admiration for Bach began during the family’s first trip to London,
1764-65, when Mozart was only eight years old. This trip marked the beginning of an
extraordinary relationship, documented in letters written by Wolfgang, Leopold and
Nannerl. Mozart met Bach at the height of the latter’s fame, when he was completely at
home in the active musical and social life of the metropolis. While in London, Mozart
enjoyed a close relationship with Bach, and apparently composed under his tutelage the Composer.
https://www.biu.ac.il/HU/mu/min-ad/06-2/8_Bach-Mozart89-104.pdf