Dislocation nucleation in the phase-field crystal model