The out-of-sample $R^2$: estimation and inference