Learning minimal representations of stochastic processes with variational autoencoders