Ok so I do it whenever I see the little legacy force lightning symbol as that is my favorite move to use. I don't know how I activate or if it is random or what. Can a Jedi knight or consular use the legacy force lightning?
Yes. The Legacy abilities are just that — usable by every character in your Legacy. There are no faction, class, or alignment restrictions on them; even a non-Force-sensitive class can use Legacy Force Lightning.
Your unlocked Legacy abilities are only usable after activating (and during) your Heroic Moment ability. They are unlocked by completing the Chapter 3 storylines for each class. You can view those unlocks by pressing Y to open the Legacy Panel and going to the "Imperial Classes" and "Republic Classes" parts of the "Global Unlocks" section at the top left.