Get an OBD scanner and plug it into the car to find out what sensors have gone bad. You can buy an OBD scanner for cheap online that connects to your phone.
Get a ready only scanner for cheap, you need one for any car 2000-04+ depending on manufacturer. Most likely you need a valve body for your CVT/AT if you haven't been changing your fluid every 4/5 years.
Did you find out what the problem is? I just got the same problem on my 2014 Forester. For my car, it might be the transmission valve body needs replacing.