Set oven at 350℉. In a skillet, over medium-high heat, cook the bacon until crisp and brown, about 8 minutes. Remove the bacon and drain on paper towel, then carefully remove fat from the pan, leaving about one tablespoon behind. Add the onions to the remaining bacon fat and cook until soft, about 5 minutes, then add apples and continue to cook until apples begin to soften, about 6 minutes. Remove from heat and allow to cool. Cook the macaroni according to package directions, then drain and reserve.
In a medium oven-safe pot, melt the butter over medium-high heat. When the butter is completely melted, add the flour and whisk over the heat until flour and butter are fully incorporated. Whisk the milk into the flour mixture, making sure to whisk out any clumps. Continue to whisk until the sauce begins to bubble and thicken, then add 1 cup of grated cheese and whisk until cheese is fully melted and incorporated into the sauce. Season to taste with salt and pepper.
Add the reserved bacon, apples and pasta to the sauce, then toss to combine. Season to taste with salt and pepper, then top with remaining cheese. Bake in the oven until cheese is beginning to brown and bubble, about 20 minutes.