Keep what you hear to yourself/don't refer that you heard it on scanner.
If you have an iPhone there are a few apps that can get the railroad frequencies, however some are partially working or only have fire/police/ems.
If you get an actual scanner enjoy it, do not abuse it, for your ears only.
Listening to a scanner is something a lot of railfans might forget is an option, it is a lot of fun listening in "behind the scenes". It is not illegal, however since they are technically publicly accessible private communications, you must keep any references as vague and unspecific as you can.
My grandparents had a few scanners over 50 years and could hear as far away as boston or charleston on clear days, they even picked up some cruise chips out in the ocean.