Adaptive Uncertainty Estimation via High-Dimensional Testing on Latent Representations