Trajectory design via unsupervised probabilistic learning on optimal manifolds