You can tell when coffee starts to lose it's freshness by the way it settles
It turns to more of a bubbly foam than a yellow liquid layer, the taste is more bitter, at least with espresso extractions.
It's probably better to buy two 250g bags and open one at a time than one 500g or more as it loses it's freshness the moment it opens, even if resealed consistently.
Some advice from your international coffee goblin