Learning Optimal Control and Dynamical Structure of Global Trajectory Search Problems with Diffusion Models