You need to dial down your tail gyro gain on your transmitter. Enter the menu on your transmitter for the model you have setup for this heli. Find the gyro gain setting (you would have had to set it up as part of setting up the 3gx so hopefully you remember how to get there). Dial the heading hold gain value back 5 points, save it, and then try flying again. Hopefully it is wagging less or has stopped completely. If still wagging a bit, then go in an dial it back another 5 points. Rinse, repeat as necessary.
What transmitter are you using?