Representation learning with unconditional denoising diffusion models for dynamical systems