Family gauge symmetry and Koide's mass formula