Terahertz phonon engineering and spectroscopy with van der Waals heterostructures