Place spinach in a skillet over medium heat and cook until wilted, 3 to 5 minutes. Drain, squeeze dry, and chop finely.
Heat 1 tablespoon butter in a skillet over medium heat and add onion. Cook until onion starts to soften, about 3 minutes. Add spinach and cook and stir for 2 minutes. Remove from heat and transfer to a bowl to cool slightly, about 5 minutes.
Stir ricotta cheese, Parmesan cheese, 2 whole eggs, nutmeg, salt, and pepper into the cooled spinach mixture.
Preheat oven to 350 degrees F (175 degrees C). Grease a 9-inch tart pan or pie dish.
Unwrap the phyllo dough. Keep covered with a damp cloth to prevent phyllo sheets from drying out.
Lay 1 sheet of phyllo over the buttered dish flush with the edge so that excess phyllo hangs over on only one side of the dish. Brush lightly with melted butter. Top with another sheet of phyllo at a slight angle to the first one. Continue in this manner, with up to 12 sheets, brushing each sheet with butter and working clockwise to lay each at a slight angle to the previous sheet.
Spoon cheese and spinach mixture evenly into the phyllo-lined dish. Using the back of a spoon, make six indentations in the filling, then carefully place 1 egg yolk in each. Season each yolk with salt and pepper and drizzle with a bit of melted butter.
Take the extra phyllo dough hanging over the edges of the dish and fold it over to the centre to cover the filling, 1 sheet of phyllo at a time, brushing each one with butter. Brush the top of the whole pie with butter.
Bake in the preheated oven until the phyllo pastry is a dark golden brown, about 40 minutes. Remove and let cool slightly before slicing. Serve warm.