why does my truck start surging shift down up going up an incline at hwy speeds? on 2001 Ford Ranger

this also feels like loss of power when down shifting at hwy speeds going up an incline or going into a headwind. then starts surging and feels like down shifting and upshifting. it stops when I accelerate hard then starts again when I shift out of passing gear. it runs find after road levels out. I don't show any diagnostics and had the trans rebuilt thinking that was the problem.still doing the same.really need some help thanks

Asked by for the 2001 Ford Ranger
Has it always done this since you have owned the truck?
no I've owned the truck sense 2003.