Preheat the oven to 325°F (163°C).
In a large skillet, combine the onion, 2 tablespoons of the butter, and a generous pinch of salt. Cover and cook, stirring occasionally, over medium-low heat until very tender and pale gold, about 25 minutes.
In a large saucepan, melt the remaining 2 tablespoons butter over medium-low heat. Add the flour and cook, whisking constantly, until the mixture smells nutty, about 2 minutes. Whisk in the milk and cream in a slow, steady stream. Still whisking, bring to a boil and cook for 2 minutes. Remove from the heat and let cool slightly, whisking occasionally.
Pour a little of the cream mixture into the eggs, whisking until completely combined. Slowly whisk this mixture back into the cream mixture in the saucepan, a little at a time, until well incorporated and smooth. Stir in the caramelized onions, then season to taste with salt, pepper, and nutmeg. Spoon the mixture onto the pate brisee, spreading it evenly.
Bake the tart until golden brown and a knife inserted in the center comes out clean, about 1 hour. Let the tart cool in the pan on a wire rack for 20 minutes, then unmold. Slice and serve warm.