hammering it will be a very difficult way to remove it. the best way will be to rig up a way to press it out either with a c clamp, bench vise or a press.
best bet would probably be nuts welded on the inside and bolts with little handles that you can twist off by hand that stay on the magwell and dont fall out of it.