06 Pontiac Grand Prix

After driving my 06 grand prix for about a hour or so it starts losing power and like the transmission is slipping. But i just had the transmission rebuilt not even a month ago. But after driving for about a hour its like its losing power and don’t wanna go.. And it makes my traction control light comes on and won’t go off.. When i park the car and let it sit over night or for a few hours it’s fine and the traction control light is off.. And the car drives fine for about nothing hour or so. Why is is doing this?