Optical study of hydrogen diffusion in yttrium iron garnet