True, there's a difference between treason and resistance.
Clearly, if you go against the state which commits crimes against elemental human rights or the one that changes to dictatorship, its no treason, but your patriotic duty towards your country. You normally have a right as a citizen to resist the acts against the constitution. Example, FFVIII
Now treason is something that is still punished with death or 30+ years in high security camp in many progressive countries. But that’s not acting against your country for its good, like the example above, but committing a crime that harms the state and the population. Example, stealing the newest bit of military technology and selling it to another state.