Development of second harmonic generation as a tool for monitoring crystallization