Prep: Remove puff pastry from freezer and allow to thaw. Preheat oven to 400°F (204°C). Remove the dark tops from the leeks. Cut off the roots, cutting as close to the root as possible (we're trying to keep the leaves all attached). Remove tough outer leaves. Gently rinse under water to remove dirt from between the leaves.
Soften: Heat 2 Tbsp of the butter in a large cast iron skillet (or oven-safe skillet) over medium heat. Add the leeks, cover, and cook, flipping occasionally, until they're soft, about 15 minutes. (you may need to work in batches). If leeks begin to brown, lower the heat. Remove leeks from pan.
Assemble: Add remaining butter, sugar, salt, pepper, garlic, and thyme to the pan. Stir and cook until melted, then remove from heat. Arrange leeks on top of the butter mixture, packing in as many as you can. You may need to cut them to fit in the smaller spaces! Sprinkle parmesan over the leeks.
Top: Gently place the thawed puff pastry on top of the leeks. Use clean scissors to trim the corners so that it fits well in the pan. Tuck in the edges. Whisk an egg and brush it on top. Cut a few slits in the tops of the pastry to allow steam to escape during cooking.
Bake: Bake for 35 to 45 minutes, or until top is golden brown. If it browns too quickly, gently cover the tart with aluminum foil.
Flip: Allow tart to cool slightly, then gently work a small knife or rubber spatula around the edge to loosen the crust from the pan. Place a plate or cutting board on top of the pan, then flip the whole thing in one quick motion. The tart should come loose form the pan and end up on the plate. If any leeks stick to the pan, simply rearrange them back onto the tart. Cut into 6 slices and serve!