Actor–Critic Methods for Optimal Control and Mean Field Games