Do you have an OBD reader? Certain codes do this. I have a 13 Crosstrek that this happened to back at 53k miles that indicated I needed a CVT replaced under warranty. I drove it for 2 weeks while waiting for the appointment.
Now, at 155k miles, I got it again and have P0700 and P2763. The first means generic "it's the transmission, buddy". The second means the lockup solenoid in the control valve which is an "all solenoids" assembly that's about $800. South Main Auto did a video on this on youtube if you want to do it yourself. Couple grand with labor.