Make the yolk mixture: In a heatproof bowl, whisk egg yolks and sugar until smooth. Set over a saucepan of gently simmering water (double boiler), making sure the bowl does not touch the water. Whisk constantly for 5 to 7 minutes until thickened and glossy. Remove from heat and cool for a few minutes (warm, not hot).
Add mascarpone: Gently fold in mascarpone until smooth. Do not overmix.
Whip the cream: In a separate bowl, whip cold heavy cream and vanilla to stiff peaks.
Fold the cream in: Fold whipped cream into the mascarpone mixture in two additions until just combined and fluffy.
Mix the coffee dip: In a shallow dish, combine cooled espresso with rum or coffee liqueur (if using).
Dip ladyfingers: Quickly dip each ladyfinger (about 1 second per side) and arrange in a single layer in a 9x9-inch dish (23x23 cm).
Assemble: Spread half of the mascarpone cream over the ladyfingers. Repeat with another layer of dipped ladyfingers, then spread remaining cream on top.
Chill: Cover and refrigerate at least 4 hours, or overnight for best slicing.
Finish: Dust with cocoa powder right before serving. Top with dark chocolate shavings if desired.