Make the pasta: Whisk both flours, the basil, both cheeses and 1 teaspoon salt in a large bowl. Whisk the milk, eggs and olive oil in a separate bowl, then pour into the flour mixture and stir with a fork until the dough comes together. Knead the dough on a floured surface with floured hands until smooth and elastic, about 5 minutes, adding more flour as needed so the dough is soft but not sticky. Wrap in plastic wrap; let rest at room temperature for 2 hours.
Cut the dough into quarters. Working with one piece at a time (keep the rest wrapped in plastic), roll the dough through a pasta machine on the thickest setting. Continue rolling the dough through progressively thinner settings, dusting with flour as needed, until it is about 1/8 inch thick. Using a knife, cut the sheet of dough into 4-by-1/4-inch noodles. Dust the noodles with more flour, then scatter on a parchment-lined baking sheet. Repeat with the remaining dough. Cover the pasta with a kitchen towel and set aside until ready to cook or refrigerate up to 4 hours.
Make the sauce: Preheat the oven to 450 degrees F. Toss the eggplant, 1/4 cup olive oil, 1 teaspoon salt and a few grinds of pepper in a large bowl. Spread on a baking sheet and roast, stirring once or twice, until tender and browned, 35 to 40 minutes. Remove to a plate and set aside.
Meanwhile, heat 2 tablespoons olive oil with the garlic and red pepper flakes in a medium saucepan over medium heat. Cook until the garlic is tender and golden, about 4 minutes. Add the tomatoes, then add 1 cup water to the empty can and add to the saucepan. Bring to a simmer and cook, stirring occasionally, until the sauce is thickened, 35 to 40 minutes. Remove from the heat, stir in the chopped basil and season with salt and pepper.
Bring a large pot of generously salted water to a boil. Add the pasta and cook until it floats to the top and is tender, 3 to 4 minutes. Reserve 1/2 cup cooking water; drain the pasta and return to the pot. Add the sauce and cook over medium heat, stirring, until coated, about 1 minute. Remove from the heat and stir in the remaining 2 tablespoons olive oil, three-quarters of the eggplant, the mozzarella and 1/4 cup torn basil. Add the reserved cooking water as needed to loosen. Transfer to a large shallow bowl. Top with the remaining eggplant and 1/4 cup torn basil; sprinkle with pecorino.