Preheat the oven to 375°F (190°C).
Heat the olive oil in a skillet over medium heat.
Add the diced onion and minced garlic to the skillet and sauté until softened, about 3–5 minutes.
Stir in the orzo and cook for 2 minutes, stirring frequently to toast slightly.
Pour in the vegetable broth and tomato sauce, bring the mixture to a simmer, and cook briefly until combined, about 1–2 minutes.
Transfer the orzo mixture to a casserole dish, then sprinkle the shredded mozzarella and grated Parmesan evenly over the top. Season with dried basil, salt, and pepper.
Bake in the preheated oven for 20 minutes, or until the orzo is tender and the cheese is melted and golden.
Remove from the oven and let sit a few minutes before serving.