Heat the oven to 375°F with a rack in the middle. Grease a 9-inch square baking dish at least 2 inches deep with 1 teaspoon butter. Core and trim the cabbage, then cut it into 1-inch pieces.
Melt 2 tablespoons butter in a wide 5- to 6-quart pan over medium heat. Cook the onion for 3 to 4 minutes until it starts to look translucent. Add the cabbage in handfuls as it wilts and season with ½ teaspoon salt. Cook uncovered for 10 to 12 minutes from the first addition, stirring, until nearly tender. Add the garlic for the final 30 seconds.
If there’s a puddle in the pan, cook for another minute or two. Lift the cabbage mixture into the baking dish, leaving any remaining liquid behind. Wipe the pan dry.
Melt the remaining 3 tablespoons butter over medium heat. Whisk in the flour and cook for 1 minute. Gradually whisk in 2 cups milk. Bring to a gentle simmer, about 4 to 6 minutes, then simmer for 2 to 3 minutes, until the sauce coats a spoon. If it’s too thick to pour, add extra milk a tablespoon at a time.
Remove from the heat. Whisk in the Dijon, remaining ½ teaspoon salt, and black pepper. Stir in half the cheddar, about 1 cup, in handfuls until melted. Fold the sauce through the cabbage in the dish and taste for salt. Top with the remaining cheddar and the Parmesan.
Bake uncovered for 25 to 30 minutes, until the edges bubble, the cheese has golden patches, and the center reaches 165°F. Tent loosely with foil if the cheese browns early. Rest for 10 minutes. Sprinkle with parsley, if using, and serve warm.