It is said that the Prophet, peace be upon him, defined three parents for a Muslim: His real parents, his parents-in-law, and his teachers. Is this correct?

I have never heard of a Hadith to this effect. It is totally unlikely that the Prophet, peace be upon him, would equate anyone with one’s own parents. In the Qur’an, dutifulness to parents is often mentioned as second in importance to belief in God’s oneness, which raises it to the highest of duties. No one suggests that such dutifulness applies to teachers or in-laws.