:%s/\(^\s*\)\@<= /\t/g
Translation: Search for every instance of 4 consecutive spaces (after the = character), but only if the entire line up to that point is whitespace (this uses the zero-width look-behind assertion, \@<=
). Replace each found instance with a tab character.