Spectral variability of GX 339−4 in a hard-to-soft state transition