R David Sperling (here) writes it seems to him that taking these medicines is permitted because
Firstly, someone who has started on a course of pills before Shabbat
may continue to take them even on Shabbat (see Shmirat Shabbat
KeHilchatah, 34, 17).
Secondly, it is not clear that someone with ADHD
is considered at all "sick" or "under the weather". See for example
Shmirat Shabbat KeHilchatah (ibid 19) that birth control pills are not
forbidden, and the footnote there (in the Hebrew edition) explains
that only cases where someone is in physical pain or weakness is
forbidden to take medicines. It could be that they have the law of a
healthy person, in which case the taking of medicines is the subject
of debate (see the Shulchan Aruch ibid, 37, and the Mishna Brurah
120). Even those generally strict on this question (ie. the
Ashkenazim) could take the lenient opinion as an extra reason for
leniency, together with the other reasons I cite.
Thirdly, the
medicines for ADHD that exist today do not cure the condition - they
merely treat the symptoms of hyperactivity and lack of ability to
concentrate. It would seem that the Rabbis only forbade medicines that
bring about a cure. (See Yalkut Yosef 328,52). Lastly, there is much
discussion about the extent to which this rabbinic decree is still in
force today when the underlying reasoning for it (ie that one may be
led to grind the plants to make the medicine) does not seem to apply
any more. (See the Tzitz Eliezer, volume 8, 15, 15 for a lengthy
discussion of this issue). Even though all the modern day poskim hold
that we do apply this decree, there is room to take the lenient
rulings together with long-term medications such as in the case of
ADHD.
As a followup, I have now explicitly seen in R Avrohom Yaged's guide to refuah on Shabbos that he writes (p. 62 and also p. 84)
A person who has been diagnosed with ADD or ADHD may take medicine for
it, even though he is not actually sick. Because he cannot function
normally without his medicine, he is considered a choleh in this
regard.
As @Shokhet mentioned in comments, it's very important idea to ask a knowledgeable rabbi for guidance in real cases. Individual circumstances differ greatly, and (especially with regard to psychiatric medication) what is optional for one person may be life-or-death for another (with obvious implications for issues surrounding Shabbos).