Hi James,
I assume you want to get the critter out alive.  If you didn't, it
could be removed by any of the methods that would have removed the
original inhabitant - freezing, cooking, etc.  Two possibilities come
to mind.  First, you could put the shell and crab in a plastic bucket
of sea water with several empty shells about the same size or
slightly larger (which you don't need for your collection).  With a
little luck the crab might decide to move into a new home, leaving
the current one vacant.  If that doesn't work, you could try
anesthetizing the beast by adding epsom salts (magnesium sulphate),
available at any pharmacy, to the water.  When the crab becomes
weakened or limp, you can shake him out of the shell, and when placed
in fresh sea water he HOPEFULLY might revive (no guarantees!).
However, if you toss him back in the ocean without a shell, his
chances of survival are slim, unless he can find another suitable
shell in a hurry.  An unprotected hermit crab is fish bait.
Regards,
Paul M.