Quantum chaos and phase transition in the Yukawa-SYK model