Understanding the emergence of the boson peak in molecular glasses