You learn to act by doing it.
The more you do it, the more automatic it is.
For example: I took ritalin on and off but with long enough phases, that I do have behavour patterns were i act like i was on ritalin (cleaning stuff etc.)
I also thought about people who drunk a lot more alcohol when they were younger: they learned how to be a certain way because they were able to act like this by drinking alcohol.
I took MDMA a lot later in life and when i was, i definitly had like a 'MDMA dance echo' in my brain after.