Although cognitive engagement (CE) is crucial for motor learning, it remains underutilized in rehabilitation robots, partly because its assessment currently relies on subjective and gross measurements taken intermittently. Here, we propose an end-to-end computational framework that assesses CE in near real-time, using electroencephalography (EEG) signals as objective measurements. The framework consists of i) a deep convolutional neural network that extracts task-discriminative spatiotemporal EEG features to predict the level of CE for two classes- cognitively engaged vs. disengaged; and ii) a novel sliding window method that predicts continuous levels of CE in short time intervals. We evaluated our framework on 8 healthy subjects using an in-house Go/No-Go experiment that adapted its gameplay parameters to induce cognitive fatigue. The proposed CNN had an average leave-one-subject-out accuracy of 88.19%. The CE prediction correlated well with a commonly used behavioral metric based on self-reports taken every 5 minutes (p =0.93). Our results objectify CE measurement in near real-time and pave the way for using CE as a rehabilitation parameter for tailoring robotic therapy to each patient's needs and skills.