My Xbox controller keeps shutting off on its own. It usually happens when a loud sound plays, in LEGO games it happens when I collect a purple stud (If you need to know, other studs don't make it disconnect.). In AirMech Arena it happens, sometimes, when I defeat an enemy (similarly, it disconnects during explosions in Ikaruga) It also happens when I suddenly shake or (accidentally) hit it on my sofa.
I've experienced this personally before. Basically, the connection of the battery pack to the controller no longer works properly, and can disconnect, even randomly, based on the level of degradation of the connection.
From memory, buying a new battery pack/switching it with another controllers pack can fix this, but the most reliable fix, other than burying a whole new controller, is getting a charge cable. This will ensure your controller has power when in use.