The mousse, cake and salted caramel can be made one day ahead of time and assembled the day of for serving.
Grease and line a 9x13 pan with parchment paper with overhang to pull the cake out easier after baking.
Make the cake
Preheat the oven to 350°F.
In a medium bowl, whisk together flour, baking powder, baking soda, spices, and salt. Set aside.
In the bowl of a stand mixer fitted with a paddle attachment, combine vegetable oil and sugars. Beat until well combined, about 2 minutes. Add eggs, one at a time, fully incorporating after each addition. Add vanilla and mix until incorporated.
Add flour mixture in 3 parts, careful not to overmix. Fold in grated carrots.
Spread batter evenly into the prepared pan and bake for 45-55 minutes, or until a cake tester or toothpick inserted into the center comes out clean.
Cool the cake in the tin for 30 minutes, then turn out onto a wire rack to cool completely.
Make the cream cheese mousse
Combine the milk and vanilla in a medium saucepan over medium heat until simmering. Remove from heat.
Combine the granulated sugar and egg yolks in a medium bowl. Whisk by hand or with beaters until light yellow and fluffy.
Add flour and cornstarch and whisk until thoroughly combined and lightened even further.
Slowly stream in warmed vanilla milk with a ladle while whisking vigorously to prevent cooking the eggs. Continue slowly adding in the milk mixture until it is all combined.
Return the entire mixture to the medium saucepan and place over low heat. Whisk constantly until the pastry cream has thickened to a pudding consistency. This can take 5+ minutes. Remove from the heat promptly and transfer to a heatproof bowl.
Cover with plastic and press down to touch the surface of the pastry cream to prevent a skin from forming. Chill at least 1 hour or place over a bowl of ice to chill it faster.
When the pastry cream is completely chilled, beat the cream cheese until completely smooth and no lumps remain. Beat the cream cheese into the pastry cream on low just until combined.
In a medium bowl, whip together the heavy cream and 2 tablespoons of granulated sugar until stiff peaks form. Gently fold the whipped cream into the completely cooled pastry cream cream cheese mixture.
Make the salted caramel sauce
In a medium heavy-bottomed saucepan, add the granulated sugar. Place over medium heat, stirring constantly with a rubber spatula or wooden spoon until the sugar is completely melted.
When the sugar is completely melted, add the butter and stir with a whisk until combined. Be careful as the mixture will sputter and bubble up.
Once the butter is incorporated, stir constantly while gradually adding the heavy cream. Be careful, again, as the mixture will sputter and bubble up. Once combined, stop stirring and boil for 1 minute or until the caramel reaches 220°F.
Remove from the heat, stir in the kosher salt and then pour into a heatproof container to cool to at least room temperature before using in the trifle.
Assemble the trifle
Dice the cooled cake into 1-inch cubes using a serrated knife. Divide the amount of cubes into three, for three layers of cake cubes.
Spoon or pipe ¼ of the cream cheese mousse into the bottom of the trifle dish.
Drizzle some of the salted caramel sauce and sprinkle some of the pecans on top. Cover with one portion of the cake cubes.
Repeat the previous steps for layering, ending on a layer of cream cheese mousse with caramel and pecans. Garnish with shaved carrot ribbons.
Notes
*Toast raw pecan halves spread in a single layer on a baking sheet in a 350°F oven for 10-12 minutes. Watch closely for burning.Store the assembled trifle covered in the refrigerator for up to 3 days.