How do we ensure students remain motivated and feel supported in class?
Feeling supported makes students more likely to feel motivated and increase their expectations for success. If the goals of the course match what students value then the alignment of expectations and values creates the highest student motivation.
However students must be pointed in an appropriate direction as they pursue the goals of the course. The ABC's of How We Learn chapter Y (Yes I can) warns that sometimes self-efficacy isn't always a good thing invoking Godwin's Law in its reference to Hitler.
Furthermore to lend greater motivation to students as they develop greater competency educational goals ought to align with the work students do and not the students themselves disentangling the doer from the activity being done.