The electric charge of a quark or lepton, $Q$, is related to the third component of the weak Isospin $T_3$ and weak hypercharge $Y$ according to the formula $$Q=T_3+\frac{Y_W}{2}.\tag{1}$$ This, in a sense, is derived in the Standard electroweak theory, by identifying the unbroken diagonal generator after the spontaneous breakdown of $$SU(2)_L\times U(1)_{Y_W}\to U_Q(1)$$ takes place.
On the other hand, the electric charge $Q$ of a quark or a hadron also obeys a similar relation $$Q=I_3+\frac{1}{2}(B+S)\tag{2}$$ where $I_3$ denotes the third component of the strong Isospin, $B$ and $S$ denote the baryon number and the strangeness quantum number, respectively.
Relation $(1)$, is derived in the Standard Model in the sense explained above. My question is: "is the relation $(2)$, to be derived instead of accepting it as an empirical relation?"