Prepare the aïoli and cook the crab
Put the garlic into a food processor or blender and process until finely chopped. Add the egg yolks and 2 Tbs. water and process until blended. With the machine running, drizzle in the olive oil very slowly until the mixture is emulsified. Once the oil has been added, stop the machine, add the harissa and preserved lemon, then pulse to blend. Transfer to a bowl and season to taste with salt and pepper. Cover the surface with plastic wrap, and refrigerate until ready to use.
Fill a 10- to 12-quart pot two-thirds full with water. Season with 3 Tbs. salt and bring to a boil.
If the crabs are very feisty, place them in the freezer for 15 to 30 minutes to calm them. Using tongs, grasp each crab from behind and place, back-side up, in the pot (if 4 crabs will not fit, cook in 2 batches). Cover the pot and return to a full boil (this may take some time), then reduce the heat and cook until the shells are bright red and the crab is cooked through, about 10 minutes. Transfer with tongs to a large colander and rinse under cold running water until cool enough to handle.
To clean, place a crab belly-side down and grasp the carapace (top shell) from the back and pull off the shell completely. Remove the soft, pointy gills and break off and discard the mouthpiece. Flip the crab over, belly-side up. Using the tip of a small knife, lift the triangular piece of shell (known as the apron) from the pointy end, and break off and discard. Rinse the crab of any viscera under cold water. Place the crab, back-side up, on a cutting board and cut in half down the middle.
Grill the vegetables
Prepare a medium-hot gas or charcoal grill and lightly oil the grill rack.
Toss the asparagus with 2 Tbs. oil, 1/2 tsp. salt, and 1/4 tsp. pepper. Coat the onion slices with the remaining 2 Tbs. oil, 1/2 tsp. salt, and 1/4 tsp. pepper. Grill the asparagus, covered, turning once, until tender, 6 to 8 minutes. Grill the onion, covered, turning once, until tender, about 10 minutes total. Transfer the vegetables to a platter.
Serve the crab, onion, and asparagus with the aïoli alongside for dipping.