We propose a non-asymptotic convergence analysis of a two-step approach tolearn a conditional value-at-risk (VaR) and expected shortfall (ES) in anonparametric setting using Rademacher and Vapnik-Chervonenkis bounds. Ourapproach for the VaR is extended to the problem of learning at once multipleVaRs corresponding to different quantile levels. This results in efficientlearning schemes based on neural network quantile and least-squaresregressions. An a posteriori Monte Carlo (non-nested) procedure is introducedto estimate distances to the ground-truth VaR and ES without access to thelatter. This is illustrated using numerical experiments in a Gaussian toy-modeland a financial case-study where the objective is to learn a dynamic initialmargin.