Preheat oven to 400°F/200°C.
Add the sweet potato and onion toa large baking pan. Drizzle with oil, salt and pepper. Toss with your hands to coat well and return to an even layer so they roast and not steam. Roast for 20 minutes then add the garlic cloves. Roast for a further 10 minutes until the potatoes are soft when a fork is inserted. Remove and allow to cool.
While they cool add the butter to a light colored pan (so you can see when the butter starts to brown) over low heat until melted and starts to bubble. Stir when you start to see brown bits appear on the bottom and skim any foam off the top. Set aside.
Cook pasta according to package directions. Cook 1 minute less than directed because it cooks more in the oven and don’t want the pasta over cooked.
Add the roasted sweet potatoes, onion, garlic, brown butter, stock and cheddar to a blender. Blend until smooth and a thick sauce consistency, add more stock if needed.
To a large bowl add the pasta and sauce with the cheese and mix well. Transfer to a large casserole/ceramic baking dish (9 x 13 inch/23 x 33 cm/3 quart/3 liter).
To a small bowl mix the breadcrumbs, Parmesan and rosemary.
Sprinkle the top with an even layer of panko/Parmesan mix and bake uncovered for 30 minutes until the top is golden brown.