I don't know the exact details (so I'll be leaving the math out anyway), but this is my understanding and I hope it helps you get some idea about what's being done.
When you look at galaxies farther away, you're looking at them farther back in time (because speed of light is constant). So, to sample the velocities of galaxies over time, you don't need to observe them for a long time, but you can work with galaxies that are at different distances, and hence at different times in the history of the universe.
Now if you notice that the recession velocities of galaxies that are farther away are slower than what you would expect from a constant expansion scenario (Hubble's law, for example), that means the universe was expanding slower, back then, than it is, now. If there is a clear trend that this is happening, then you can say that the speed of expansion of the universe has been increasing over time. This means that the universe is accelerating.
Of course, this is a lot more complicated, since if the universe is accelerating, Hubble's law itself becomes shaky, if not invalid (as it assumes a direct proportionality between distance and recession velocity). Also, if you cannot find distance using Hubble's law, then you have to have an independent distance measurement that far away, which is also problematic, since afaik, there aren't such distance indicators that are valid that far away (since physics is different due to changes in stellar metallicities etc.; a lot of problems start showing up). So I don't know how this is done in practice, but in theory what I described above is how one would arrive at the conclusion of an expanding universe. I would like to know how this is really done in practice, as well.