Overdrive

I have a 1997 Mazda 626 and a few months ago as I’m driving all of a sudden the rpm’s start jumping and the car acts like it’s trying to shift gears. The car has been in the shop twice and they tell me they know there’s something wrong but they can’t find it and they also say it’s NOT the transmission. I now rarely drive over 40-45 mph and have to take the back roads to work. I’m not sure if I should try another mechanic so they can tell me the same thing. I can’t afford a new car just yet but this problem is driving me nuts and scaring me to death. Please help.

Automatic or manual transmission? And does the car speed vary, or just the engine’s?