Bring a large pot of salted water to a boil and cook the penne according to package directions until al dente; drain and set aside.
While the pasta cooks, heat the olive oil in a large skillet over medium heat.
Add the chopped onion and diced tomato to the skillet and cook, stirring frequently, until the onion is translucent, about 4–5 minutes.
Stir in the minced garlic, season with salt and pepper to taste, and cook over medium-low heat for 2–3 minutes.
Sprinkle the flour over the vegetables and cook, stirring, for 1 minute to remove the raw flour taste.
Gradually whisk in the milk and add the Italian seasoning, whisking constantly to prevent lumps; bring the mixture to a gentle boil.
Reduce the heat and simmer, stirring occasionally, until the sauce thickens, about 3–4 minutes; adjust consistency with more milk or a little more flour if needed.
Add the hot, drained pasta and shredded mozzarella to the skillet and stir until the cheese melts and the pasta is evenly coated.
Remove from the heat to prevent the sauce from over-thickening and serve immediately.