The most common method I seen, and the one I prefer is to rip a leg off then shove the hook through the leg and out through the chest. Then wrap the remaining legs around the shank of the hook with heaps of bait elastic.
Others like to peel off the shell, remove the legs then fold the crab in half before tying it together with heaps of elastic.
While others (for big crabs) cuts them into slices which they tie onto the hook with bait elastic.