Sounds like you have a transmission problem there! Unfortunately this is something that would need to be diagnosed in person by a technician. You could have something simple like a transmission electrical component that is going bad, or worse such as need a complete overhaul. Usually with a problem like this the transmission needs to be removed, disassembled and diagnosed.
GM Dealer Technician For 18+ Years In the automotive industry for 20+