Preheat oven to 425 degrees. Line 2 baking sheets with aluminum foil and grease with cooking spray.
Arrange eggplant slices on baking sheets and brush with olive oil. Roast for 20 to 25 minutes, flipping halfway through. Remove from oven and set aside.
In a medium-size bowl, combine ricotta, eggs, 1/2 cup mozzarella, 1/2 cup Parmesan, 1/2 teaspoon garlic powder, 1/2 teaspoon salt, 1/4 teaspoon thyme, and 1/4 teaspoon black pepper. Stir until well combined, then set aside.
To make the sauce, heat olive oil in a medium-size pot over medium heat. Add onions and saute for about 3 minutes, until softened. Add garlic and cook for about 20 seconds, until fragrant.
Add remaining 1/2 teaspoon thyme, 1/4 teaspoon garlic powder, 1/4 teaspoon salt, 1/4 teaspoon black pepper, parsley, bay leaf, red pepper flakes, and tomato paste. Stir until well combined and let cook for 1 minute.
Using a sharp knife, break up tomatoes while still in can. Add to pot and break up further. Add sugar and stir to combine. Bring heat to a low simmer and cook down for 2- minutes, until thickened.
Taste and add additional salt, pepper, spices, or sugar if desired. Turn off heat and set aside.
Adjust oven temperature to 375 degrees. Spoon a ladleful of sauce onto the bottom of a 9x13 baking dish. Place a layer of eggplant slices on top of the sauce, then a layer of tomato slices on top of the eggplant.
Dollop the ricotta mixture over the tomatoes an using a spatula, spread in an even layer. Sprinkle 1/4 cup mozzarella over the ricotta mixture, then 1 tablespoon basil.
Continue layering in the following order: eggplant, tomatoes, sauce, ricotta, mozzarella, basil for 3 layers, reserving some basil for garnish. Once you lay the last row of eggplant slices, top only with sauce, remaining 3/4 cup mozzarella and remaining 1/4 cup Parmesan.
Cover baking dish with loosely tented aluminum foil, place on baking sheet and bake for 30 minutes.
Remove foil and broil for 3 to 5 minutes, until golden brown and bubbly. Remove from oven, let rest for 15 minutes, then garnish with remaining basil and serve,