It's in his commentary to Ex. 27:20:
מאמר הובא בס' זוהר חדש כי ד' גליות של ישראל כל א' מהם נגאלו ממנו בזכות אחד... והד' תלוי בזכות משה, ולזה נתארך הגלות, כי כל עוד שאין עוסקים בתורה ובמצות אין משה חפץ לגאול עם בטלנים מן התורה
...a statement in Zohar Chadash, that the Jews were redeemed from each of their four exiles in the merit of another person... The fourth depends on the merit of Moshe; this is why the exile is so long, for as long as we aren't occupied with Torah and mitzvos, Moshe doesn't want to redeem a people who are neglectful of Torah.
He also mentions this more briefly in his commentary to Deut. 30:6:
שבזכות עסק התורה יהיו ישראל נגאלין
...that in the merit of being occupied with Torah study, the Jews will be redeemed.