Heat oven to 350°F. Grease a 2½-quart casserole dish.
Cook macaroni according to package directions. Drain and set aside.
Melt 1 tablespoon butter in a medium skillet over medium-high heat. Add onion and cook, stirring often, until very soft and golden brown, about 12 minutes. Set aside.
Melt remaining 2½ tablespoons butter in a large saucepan over medium heat. Add flour and cook, stirring constantly, until mixture is pale yellow and frothy, about 2 minutes. Do not allow it to brown.
Slowly whisk in milk, continuing to whisk until roux boils and thickens enough to coat the back of
a spoon, 2 to 3 minutes. Season with salt, pepper, and nutmeg.
Reduce heat to low, add 3 cups of cheese, and stir until cheese melts. The sauce should be the consistency of pancake batter, so thin with milk if necessary.
Stir in macaroni, onions, parsley, rosemary, and thyme, and pour mixture into the greased dish. Sprinkle remaining ½ cup cheese over the top.
In a small bowl, toss bread crumbs with 2 tablespoons melted butter and sprinkle over the casserole.
Bake until casserole is warmed through and the top is lightly browned, about 30 minutes. Let sit for 10 minutes and serve warm.