A “good regulator theorem” for embodied agents