Preheat your oven to 375°F (190°C).
In a saucepan, heat olive oil over medium heat. Add minced garlic and cook until fragrant.
Stir in the flour and cook for a minute.
Gradually whisk in the almond milk, making sure there are no lumps.
Add nutritional yeast, salt, and pepper. Cook until the sauce thickens.
In a baking dish, layer half of the potatoes and onions.
Pour half of the sauce over the layered potatoes and onions.
Repeat with the remaining potatoes, onions, and sauce.
Cover with foil and bake for 30 minutes.
Remove the foil and bake for another 15 minutes, or until the potatoes are tender and the top is golden brown.
Garnish with fresh parsley if desired.