Here's a reminder of what the crab looks like when its legs are outspread. Also note the prominent spine pointing backwards at the tail end. Because of this spine and the size of the crab, Seth suggested this is most likely a crab in the genus Cancer.
I was struck by those beautiful blue eyes.
At this stage, sometimes the crabs crawl on the bottom. Other times they pull in their legs and swim. The next image is a view from below while in the tucked position. You can see the narrow abdomen extending out behind the crab, with feathery pleopods extended. They flap the pleopods to swim.
In this position, you can also see the claws that are already well developed.
Here's the megalopa in a tucked position again, but this time from above.
When I was reviewing these pictures, I noticed a long, slender, pointed structure lying on the inside of the eyes that I was curious about. See next image for a close-up.
I haven't watched live megalopae enough to know what these structures were at first. But after puzzling over them and looking at various pictures, I think they're the hind legs!
I looked for a picture that would confirm my hypothesis and found this one. This is a view from below. The crab should have four walking legs. The yellowest structures visible below are the first two walking legs folded underneath the crab. But the last two walking legs do appear to be folded above the crab, up and over its back. I had no idea they would hold their legs in that position. Two above and two below!
Crabs spend several weeks (a few months in some species) as planktonic larvae swimming in the open ocean. The larvae then undergo metamorphosis into megalopae and alternate between swimming and crawling on the bottom (or into a kelp holdfast). They may spend up to a month as a megalopa before becoming a juvenile crab that looks like a miniature adult.