Is there such a feature built in? Is there a third party app?
Not built-in. In some countries it's legally questionable. There aren't any good FM radio alternative apps because it's hard to develop and pretty much obsolete/unsupported anymore. I think you could mess with some kind of an audio sink recorder (records system-wide output audio stream) but root might be required.