Combine first 3 ingredients in a large heavy saucepan; whisk in milk. Cook over medium heat, stirring constantly, until thickened and bubbly. Gradually stir about one-fourth of hot mixture into egg yolks; add to remaining hot mixture, stirring constantly. Cook over medium heat, stirring constantly, 3 minutes. Remove from heat; add vanilla. Cool to room temperature. Assemble trifle, or cover and chill custard until ready for assembly.