How do I hijack an Atlas? I have managed to shatter the cockpit glass but I do not see any option to hijack it when I get in close and it blows if I kill the pilot.
If it blows up you damaged the Atlas too much. You need to both shatter the cockpit and kill the pilot, you'll see no prompt to hijack it before you kill the pilot.
I'd try to kill the pilot with a lower damage weapon, to avoid blowing up the mech at that point. An upgraded high-damage sniper rifle might deal to much damage at once for this to work.