Optical Phonon Modes and Localized Effective Charges of Transition-Metal Dichalcogenides