Preheat the oven to 350 degrees Fahrenheit (180 degrees Celsius) with top and bottom heat.
Cut the eggplants into long slices, about 1 cm thick, and lightly brush both sides with olive oil.
Fry the slices in a hot frying or grill pan in batches until golden brown and soft, about 2-3 minutes per side. Place them on paper towels to drain.
Heat some olive oil in a frying pan over medium heat. Fry the onion and garlic until soft and translucent.
Add the passata, along with the oregano, dried basil, sugar, black pepper, and a pinch of salt. Let the sauce simmer for 10 to 15 minutes, until it is slightly thickened.
Cover the bottom of the baking dish with a thin layer of tomato sauce. Then, add a layer of eggplant, followed by a layer of mozzarella and some Parmesan cheese.
Repeat these layers until all the ingredients are used, ending with a layer of tomato sauce and grated Parmesan.
Bake the melanzane alla parmigiana for 30 to 35 minutes or until the cheese is golden brown and bubbling.
Let it rest for a few minutes before serving. Garnish with fresh basil leaves and serve warm. Enjoy!