How to install tcpdump on BalenaOS

What is the best way to install tcpdump and be able to record packets to a file that can later be downloaded?

You would need to install tcpdump in a container, and if that container is in host network mode, you should be able to capture traffic between the host and the physical network. (See Communicate outside the container - Balena Documentation for networking mode)