Combine the apples, raisins, lemon juice and ginger in a bowl. Melt the butter in a skillet set over medium heat. Add the apple mixture, increase the heat to medium-high, and cook for 1 minute. Stir in 2 Tbsp. of the sugar. Cook, stirring, for 4 to 5 minutes, or until the apples are lightly caramelized. Spoon the apple mixture and its syrup into a lightly buttered 8-inch x 8-inch baking dish. Preheat the oven to 325 degrees F. Place the milk in a medium pot, whisk in the remaining sugar, egg yolks, nutmeg and vanilla and set over medium heat. Warm to just below a simmer and then pour over the apple mixture. Set the baking dish in large roasting pan; add enough hot water to come half way up the sides of the baking dish. Bake for 50 minutes, or until the custard is set. Cool to room temperature, sprinkle with walnuts and then refrigerate until ready to serve.