Butter a shallow oval gratin dish that is about 12 inches long, or a 2-quart baking dish.
Heat 1 tablespoon of the olive oil in a large, heavy, nonstick sauté pan over medium-high heat and add the garlic and red pepper flakes. Sauté until glossy, 20 to 30 seconds, and add the tomatoes, sugar, and salt and pepper. Sauté, stirring often, until the tomatoes cook down to a chunky sauce, about 15 minutes. Taste and correct seasonings, stir in the basil, and transfer to a bowl.
Clean and wipe dry the sauté pan and add 2 tablespoons of the olive oil.
Heat over medium-high heat. When the olive oil is hot, add the eggplant slices in an even layer. Cook on both sides until browned and tender, 3 to 5 minutes per side. Drain on paper towels.
On the bottom of the dish, arrange half the eggplant slices, overlapping each other slightly in concentric rings to form a single layer. Sprinkle evenly with salt and pepper. Top with half the tomatoes. Repeat the layers. Layer on the shredded cheese. Drizzle on the remaining tablespoon of olive oil.
Bake for 25 minutes, then turn the oven heat down to 350°F Bake another 20 minutes, or until the eggplant slices are completely tender when pierced with the tip of a sharp knife and the top is lightly browned. If the cheese begins to brown too much before the eggplant is done, cover the baking dish with foil.
Present the baking dish at table on a heatproof pad, scooping individual servings onto each plate.