Preheat the oven to 350ºF or 180ºC.
Add the vegan butter to a saucepan and when it’s melted, add the garlic and the onion, and cook over medium-high heat until golden brown, stirring frequently.
Add the flour, whisk until there are no lumps, and cook for 1 more minute.
Gradually pour in the vegetable stock, and whisk until well combined. Then add in the plant milk, salt, and pepper, and whisk again until combined.
Cook for 1 or 2 more minutes or until the sauce thickens. Remove from the heat and set aside.
Grease a 9×13 inch baking dish (about 23×33 cm). Place half of the potatoes on the bottom of the pan and top evenly with half of the sauce. Then sprinkle evenly half of the vegan shredded cheese.
Top evenly with the remaining sliced potatoes, the other half of the sauce, and the other half of the vegan shredded cheese.
Cover with aluminum foil and bake for 30 minutes. Then remove the foil and bake uncovered for another 30 minutes, or until the potatoes are golden brown and tender.
Serve immediately or store leftovers in an airtight container in the refrigerator for up to 5 days.