Learning Diffusion Models with Flexible Representation Guidance