i wouldn't even touch the rod before the first lesson - bad habits are hard to break & the nuances of proper casting technique are, well subtle (some people have a way with words, other people...)
i'd get a lesson or two (needn't be on the water, btw) and then find a park or something to practice dry casting (no need to attach a fly - just cast the line).
sounds to me like the hard part is that you also have to learn about streams & trout if you are actually intending to catch fish (for a lot of fly fisherfolk i've met, the catching of fish seems almost to be secondary). fortunately, once you get the hang of the hookset, most of the fishing along the JMT (especially the streams) is pretty easy in that there are plentiful fish and they are not shy to bite.
in a lot of places, it won't really be necessary to "cast" the fly, anyway - you can "dap" the fly or simply flip a short length of line with a dry fly & get a lot of trout that way.
also, be good to try a lot of different rods out (after a lesson) to see what kind suits you - i prefer a soft action, but this is also harder to use in windy conditions, which are often the case along the JMT