Step 1Halve the squash and scrape away the seeds and membranes, then cut the flesh into 4-inch-square pieces. (If using butternut, cut it in half crosswise just above the bulbous bottom part, then cut these halves into lengthwise quarters and scrape away the seeds and membranes.)
Step 2Steam the squash until tender, 15 to 20 minutes, then transfer to a colander and allow to cool and drain for another 15 minutes (butternut squash will not be watery). When the squash has cooled, peel and place in a bowl. Mash it with a fork, a large wooden spoon, a potato masher or a pestle. Stir in the parsley, mint, nutmeg, feta and Parmesan.
Step 3Heat the oven to 375 degrees. Heat 2 tablespoons of olive oil in a large nonstick skillet over medium heat and add the leeks. Cook, stirring, until tender and just beginning to color, about 5 to 10 minutes. Add the garlic and continue to cook for another minute, until fragrant. Remove from the heat and add to the squash. Beat the eggs and remove 2 tablespoons for brushing the tart, then mix with the squash. Season to taste with salt and pepper.
Step 4Brush a 10- or 12-inch tart pan or cake pan with 1 tablespoon of olive oil and layer in 4 sheets of filo dough, placing them not quite evenly on top of each other so that the edges overlap the sides of the pan all the way around. Brush each sheet with olive oil (or a mixture of olive oil and melted butter) before adding the next sheet.
Step 5Fill with the squash mixture and fold the edges over. Brush the folded-over filo with olive oil, then layer 5 more sheets of dough over the top, brushing each sheet with olive oil. Crimp the edges into the sides of the pan.
Step 6Brush the top with the beaten egg you set aside. Pierce the top of the pie in several places with a sharp knife.
Step 7Bake until the top is golden brown, 40 to 50 minutes. Serve warm or at room temperature. Recrisp the crust if necessary in a 375-degree oven for 10 to 15 minutes.