Quite simple this.
I used Lily Shen to hack a MEC, her hacking stat is high, so it's advisable to use her, if you have a better hacker, use them instead.
Simply walk the MEC, next to an enemy with it's first move, then prime the self destruct, and detonate. Nice and easy.
I assume this isn't quite the intended way to do it, so it may be patched in the future.