Theory and applications of latent network geometry