A system and methods for monitoring and controlling a mental state of a subject are provided. In some aspects, a method includes receiving physiological and behavioral data acquired using the plurality of sensors while the subject is performing a task, and applying, using the data, a state-space framework to determine a plurality of decoder parameters correlating brain activity and behavior with a mental state of the subject. The method also includes identifying the mental state of the subject using the decoder parameters, and generating a report indicating the mental state of the subject. In some aspects, the method further includes generating, based on the identified mental state, a brain stimulation to treat a brain condition of the subject.