I am trying to self-learn set theory from Analysis 1 by Terence Tao. I am facing a problem understanding how he shows the relation $\in$ for sets follows the axiom of substitution.
He begins by informally defining sets and the $\in$ relation. He then states the axiom: all sets are objects. Instead of stating the axiom of extension, he defines what it means for two sets to be equal.
(Definition 3.1.4.) Two sets $A$ and $B$ are equal iff every element of $A$ is an element of $B$ and vice versa.
He then leaves proving the fact that equality of sets is reflexive, symmetric and transitive to the reader. This is what he says next:
Observe that if $x \in A$ and $A=B$, then $x \in B$, by Definition 3.1.4. Thus the “is an element of” relation $\in$ obeys the axiom of substitution (see Section A7). Because of this, any new operation we define on sets will also obey the axiom of substitution, as long as we can define that operation purely in terms of the relation $\in$.
What I don't understand is how does $x \in A$ and $A=B$, then $x \in B$ show that the relation $\in$ obeys the axiom of substitution? To me it seems like the argument implies that the relation of equality obeys the axiom of substitution instead. What am I missing here?