It is obtained upon reaching Galactic Cadet Level 9, choosing to take the MEGA WEAPON, and using it to kill The Destroyer. Alternately, if you say that one man shouldn't have all that power, you will instead loot it off of Captain Atlas's corpse in Mech City so you can use it to kill the Destroyer. Either way, the MEGA WEAPON will be Legendary (Gold) quality and fully leveled when obtained.
If you choose to side with The Destroyer, you will not receive the MEGA WEAPON.
The MEGA WEAPON is fairly similar to the Hypercannon Ultimate Weapon -- it fires a long projectile that pierces through enemies, and it only fires horizontally. However, the MEGA WEAPON has a unique weapon sprite and inventory icon, and its damage is merely the character's Dexterity stat. Additionally, the MEGA WEAPON is the only weapon that can bring down the shields of the Destroyer in Mech City (it does not work on the Destroyer in the Ancient Ruins).
The MEGA WEAPON adds +29 to all stats while equipped, implying that in its base form, (which is never encountered in normal play) it adds +2 to all stats while equipped.