Preheat the oven to 190°C (gas mark 5) and grease a 23cm square baking dish with unsalted butter.
Cook the macaroni according to the packet instructions until al dente. Drain well and set aside.
Peel, core and dice the Granny Smith apples into roughly 1cm pieces.
Melt half the butter in a large frying pan over a medium heat. Add the apples, half the caster sugar and half the ground cinnamon. Cook, stirring occasionally, for 5–7 minutes, until the apples are just softened. Remove from the heat.
In a large bowl, whisk together the eggs, milk, the remaining caster sugar, the light brown sugar, the remaining ground cinnamon, the ground nutmeg, the vanilla extract and a pinch of salt until smooth.
Gently fold in the macaroni and the sautéed apples until evenly coated, then pour the mixture into the prepared dish.
Melt the remaining butter and drizzle it evenly over the top of the macaroni mixture.
Bake for 35–45 minutes, until the top is golden and the centre is set – a skewer inserted should come out clean. If it browns too quickly, loosely cover with foil.
Leave to rest in the dish for 10–15 minutes before serving.