The transmission fluid is cooled with the engine coolant, and keeping the engine coolant temperature under control is more difficult with the AC on. I expect whatever the problem is, it is caused b/c the transmission fluid is getting hot. The first step is making sure the engine coolant temperature remain in spec even on hot days with the AC on. If that’s ok the next step is to use compatible scan tool to check for transmission codes. Still nothing found? Next then is a proper transmission service. How that is done depends on the car’s design but usually includes cleaning the bottom of the pan and replacing the transmission filter and always includes replacing the transmission fluid with fresh, and verifying the fluid level is spot on.