Preheat oven to 375°F (190°C) and lightly grease a 9×9 inch baking dish.
Cook 1 cup elbow macaroni according to package directions until al dente, drain well and set aside.
Peel, core, and dice 2 large Granny Smith apples.
In a large skillet over medium heat, melt 2 tablespoons unsalted butter, add diced apples, 1/4 cup granulated sugar, and 1/2 teaspoon ground cinnamon; cook, stirring occasionally, for 5–7 minutes until apples are slightly softened, then remove from heat.
In a large bowl, whisk together 2 large eggs, 1 1/2 cups whole milk, remaining 1/4 cup granulated sugar, 1/4 cup packed light brown sugar, remaining 1/2 teaspoon ground cinnamon, 1/4 teaspoon ground nutmeg, 1 teaspoon vanilla extract, and a pinch of salt until smooth.
Gently fold cooked macaroni and sautéed apples into the egg–milk mixture, then pour into the prepared baking dish.
Melt remaining 2 tablespoons unsalted butter and drizzle evenly over the top of the macaroni mixture.
Bake for 35–45 minutes until the top is golden brown and the center is set (a knife inserted comes out clean); if browning too quickly, tent loosely with foil.
Let cool for 10–15 minutes before serving.