When I’m driving, sometimes the car over revs and jerks when I shift gears after the cars been on for a while

After awhile of driving, the car sometimes revs high (like when you give the car gas when it's in neutral) I usually let go of the gas until it catches back (if you get what I'm saying) it usually happens around second gear at about 2500 to 3000 rpms. It starts to happen maybe about a half hr after I turn the car on driving around town (on the highway I'm fine) and when I shift gears from like Reverse to Drive it takes a couple of seconds and then the car jumps. Can you tell me what that is? (I'm thinking transmission but I'm no mechanic) Thanks

My car has 157000 miles.

– When I’m driving, sometimes the car over revs and jerks when I shift gears after the cars been on for a while