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.
Add the orzo to the skillet and cook, stirring, for about 2 minutes to toast slightly.
Pour in the vegetable broth and tomato sauce, stir to combine, and bring the mixture to a simmer.
Transfer the orzo mixture to a casserole dish and spread it into an even layer.
Sprinkle the shredded mozzarella and grated Parmesan evenly 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.
Let rest a few minutes before serving.