Dice onion and add to melted butter/margarine and cook until tender. Here you can either make a rue with the flour and add milk gradually to avoid lumps (or add flour/water mix at the end to thicken). Once all milk has been added, cheese is added and heat is low to avoid scorching. If you didn't make the rue, add the flour/water mix now. Salt once thickened if needed.
Once cheese sauce is thickened, add to the pasta. It may look like more sauce to pasta, but it soaks into it and is very creamy.
I've also done this as a casserole and added buttered Ritz crumbs to the top and baked.