Only your hydrometer knows the difference. Once the reading is the same for 3 days in a row it's finished fermentation and just outgassing. At three weeks I'd guess fermentation is most likely finished.
If you have a carboy or Better Bottle, it's easy to tell - shine a flashlight in there and see where the bubbles originate. If they all come from the yeast bed, you've got fermentation (or, at least, organic activity - anaerobic breakdown of organic matter can also release gases unrelated to fermentation). If the bubbles originate from the walls of the carboy well above the yeast bed, you've got outgassing.
As long as your expected final gravity has been reached and has remained stable for a week or so, you can convince those last, persistent yeast to quit by cold crashing.