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 4–5 minutes.
Stir in the orzo and cook, stirring, for 2 minutes to toast slightly.
Pour in the vegetable broth and tomato sauce, bring to a simmer, and cook briefly until combined, about 2–3 minutes.
Transfer the orzo mixture to a casserole dish in an even layer.
Sprinkle the shredded mozzarella and grated Parmesan over the top, then 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 bubbly and golden.
Remove from the oven and allow to rest a few minutes before serving.