How to Make It
In a medium saucepan, melt the butter. Add the shallot and cook over moderate heat until softened and lightly browned, 3 to 5 minutes. Stir in the flour and cook until bubbling, about 1 minute. Gradually whisk in the milk and bring to a boil, whisking. Cook over moderate heat, whisking frequently, until the sauce is thickened and no floury taste remains, 5 to 7 minutes. Stir in the mustard and nutmeg. Season the béchamel with salt and pepper. Let cool.
Line a large rimmed baking sheet with parchment paper. On a lightly floured work surface, roll out each piece of puff pastry to a 10-by-6-inch rectangle. Slide 1 pastry rectangle onto the prepared baking sheet. Spread one-third of the cooled béchamel on the first pastry, leaving a 1-inch border all around. Sprinkle half of the cheese on top and cover with half of the ham. Repeat the layering with another third of the béchamel and the remaining cheese and ham. End with a final layer of béchamel. Cover the tart with the remaining pastry and press all around the edge to seal. Crimp the edge decoratively. Using a paring knife, cut four 1-inch slits in the top of the tart, then brush all over with the egg wash. Refrigerate until chilled, about 20 minutes.
Preheat the oven to 450°. Bake the tart for 20 to 25 minutes, until puffed and golden brown. Let cool for 10 minutes before serving.