I suspect that this is actually a paraphrase of Seder Nashim, Tractate Kiddushin, 30a. I found a Talmudic reference (36a) to the saying in The World’s Religions After September 11 (2008), by Arvind Sharma [http://bit.ly/2vfVVjc, footnote http://bit.ly/2v7PU7u%5D. However, I think the footnoted reference is a typo and that the saying is actually derived from the reference above [http://bit.ly/2w8d4rs], which says, in part, “whoever teaches his son Torah, the verse [Deuteronomy 4:9] ascribes him credit as though he taught him, and his son, and his son’s son, until the end of all generations.”

And though I haven’t looked at any Hebrew in over 50 years, I believe the original passage from which the English phrase above was translated might be the following:
המלמד את בנו תורה מעלה עליו הכתוב כאילו למדו לו ולבנו ולבן בנו עד סוף כל הדורות