Prepare the eggplant: Peel the eggplant and cut lengthwise into long slices, about 1/4 of an inch thick. Layer the slices in a colander. Sprinkle each layer generously with salt. Continue to layer the slices until finished. Allow the eggplant to drain in the sink for a minimum of 30 minutes but you can allow to sit longer while you prepare the sauce.
Make the sauce: Heat the olive oil in a saucepan or skillet over medium heat. Add in the garlic and pinch of hot pepper flakes (if using). Cook until garlic is fragrant being careful to not let brown – about 30 seconds to 1 minute. Add in the diced tomatoes. Allow the sauce to come to a simmer. Cook until the tomatoes break down and the sauce thickens - about 20 minutes. (Allow the sauce to become thick and chunky so the finished dish is not too watery.) Once thickened, season with salt and freshly ground black pepper. Chiffonade a few basil leaves (roll lengthwise and cut into little slices.) Stir to combine. Taste and adjust any seasonings.
Roast the eggplant: While the sauce is cooking, preheat the oven to 425 degrees Fahrenheit. Lightly coat 2 sheet pans with olive oil. Rinse and dry the eggplant slices. Lay the slices on the pan and brush he tops with additional olive oil. Sprinkle with salt and freshly ground pepper. Bake until soft and golden, about 20 minutes. Check half way through and turn slices. Remove from oven. Allow to cool until possible to handle. Maintain oven temperature.
Assemble and bake: In a baking dish, spread a thin layer of the tomato sauce on the bottom. Layer about 1/3 of the eggplant slices over the tomato sauce. Spread with another thin layer of tomato sauce. Sprinkle with about 1/3 of the mozzarella and a dusting of Parmigiano. Repeat with the remaining eggplant, tomato sauce and cheeses. I give the top an extra dusting of Parmigiano. Bake until the cheese has melted and the sauce is nice and bubbly, about 25 minutes.
Allow the dish to rest for about 15 minutes before serving. Buon appetito!