Frequencies of intermolecular vibrations in electronically excited dimers and charge-transfer complexes in solids