Add the cubed pumpkin to a pot, cover with water, add salt, bring it to a boil then let it simmer for 4 - 5 minutes.
Turn off the heat, drain the pumpkin, reserve.
On a pot in medium heat, add the olive oil and the sliced onions, stir for 1o minutes or until they are dark golden brown. Add the garlic, stir for 40 seconds more, add the vegan butter, when it melts, add the flour. Stir for 1 minute.
Add the milk little by little, adjust the salt and pepper, add the nutmeg and the nutritional yeast.
Turn off the heat, preheat the oven to 185C (365F).
On a baking dish, add the cooked pumpkin, cover with the béchamel sauce, sprinkle some vegan cheese, and bake it for 30 minutes.
Turn on the grill to the max temperature for 3 minutes.
Remove the pumpkin gratin from the oven and serve it.