Preheat oven to 350 F degrees.
Cook macaroni according to the package instructions, for half the time.Drain and set aside.
In a skillet fry the bacon and keep half of the oil from it.
Saute onions over medium-low heat for 10 to 12 minutes in the oil left over from the bacon, or until golden brown. Set aside.
In a pot, melt 2 tablespoons butter. Sprinkle in flour and whisk to combine. Cook, stirring constantly, over medium heat for 1 minute. Pour in milk, then cook for 3 to 5 minutes or until thick. Reduce heat to low. Add salt & pepper to taste.
Beat the egg yolk and drizzle 1/4 cup hot mixture into the beaten yolk, stirring constantly. Stir to combine. Pour egg mixture into sauce and cook for another minute.
Add cheeses and stir until melted. Add 3/4 of the onions and bacon and stir. Taste for seasonings and add more salt if needed. Add cooked macaroni and stir to coat.
Pour into a baking dish, top with remaining onion and bacon and bake for 25 minutes or until sizzling and hot.