On Shabbos 147b the phrase is found:
דתניא אמר רבי כשהיינו למדין תורה אצל רבי שמעון בתקוע
I understand that the word “רבי" refers to Rebbi Judah ha-Nasi, the compiler of the mishnah, and that the term “תניא" refers to a Beraisa which is a tradition in the Jewish oral law not incorporated in the Mishnah.
“Rebbi Shimon bar Yochai established an academy in Tekoa where the top minds of the day studied, including Yehuda haNasi” (see here).
Why therefore is a statement by רבי included in a Beraisa and not in a mishnah?