I think my transmission is going out.

Have you reset the PCM?
I have an 07 Ram with the 5.7 and 545RFE. The factory exhaust Y-Pipe developed a crack causing a CEL. Apparently the O2 sensor was throwing a code in which case, I had the same symptoms as you (slipping transmission and surging engine). With that said, is there any trouble codes?
I have reset the PCM. My Diablo trinity will not read or clear the TCM codes. It is factory PCM and Hotwire harness. I will take it and get another scan on it from a shop.