Brain state identification and neuromodulation to promote recovery of consciousness