Bring a large pot of generously salted water to a rolling boil, until it bubbles vigorously and smells slightly salty.
Add the pasta to the boiling water and cook until just shy of al dente, about 8-10 minutes. Stir occasionally to prevent sticking, and listen for a gentle bubbling.
While the pasta cooks, heat a generous splash of olive oil in a skillet over medium heat until it shimmers and begins to ripple.
Add the sliced eggplant to the skillet, spreading it out in a single layer. Sprinkle with a pinch of salt and cook, stirring occasionally, until golden brown and caramelized, about 10 minutes. The eggplant should feel soft and have a smoky aroma.
In the last 2 minutes of cooking, add minced garlic and crushed red pepper flakes to the skillet. Stir until fragrant and garlic is lightly golden, about 30 seconds.
Drain the pasta, reserving about a cup of the starchy cooking water. Set aside.
Add the drained pasta to the skillet with the eggplant and garlic. Pour in the tomato sauce and a splash of the reserved pasta water, stirring to combine everything evenly. Let it simmer for 2-3 minutes until the sauce thickens slightly and coats the pasta well.
Remove from heat and sprinkle generously with grated ricotta salata. Add torn basil leaves and give a gentle toss to distribute the herbs and cheese evenly.
Finish with a squeeze of lemon if desired, then serve hot, enjoying the fragrant, saucy pasta with hints of smoky eggplant and fresh basil.