For SARSA algorithm, assuming that we initialize all $Q(s,a)$ to $0$, then in the first iteration, all actions are the best actions as $Q$ values are the same ($0$). So the behavior policy in this iteration is like, with probability $1 - \varepsilon$, we select an action from $\mathcal{A}(S_1)$ with probability $\dfrac{1}{|\mathcal{A}(S_1)|}$ (as all actions for this state have the same $Q$ values), and with probability $\varepsilon$, we also select an action from $\mathcal{A}(S_1)$ with probability $\dfrac{1}{|\mathcal{A}(S_1)|}$. Let's denote this policy as $\pi_1$. In the second iteration and so on, the $Q$ values have changed. We can have fewer best actions for a certain state, so the policy $\pi_2, \pi_3, \dots$ is now changed. For example, the policy $\pi_n$ can be: with probability $1-\varepsilon$, choose action $A_{n+1} = \underset{a}{\arg\max}Q(S_n,a)$, and with probability $\varepsilon$, we select an action from $\mathcal{A}(S_n)$ with probability $\dfrac{1}{|\mathcal{A}(S_n)|}$.
From Sutton's book:
On-policy methods attempt to evaluate or improve the policy that is used to make decisions, whereas off-policy methods evaluate or improve a policy different from that used to generate the data.
What I do not understand here is that an on-policy method tries to "improve the policy that is used to make decisions," but at different iterations, the policies are not the same. They might belong to the $\varepsilon$-greedy policy class, but the operator $\underset{a}{\arg\max}$ can output different actions per iteration, thus leading to different $\pi_n$. For now, I am still confused about the definition of on-policy. Could anyone please provide some clarification on this?
At the moment, the only way of thinking that makes sense to me is that the behavior policy in SARSA is a class of policy, for example, the $\varepsilon$-greedy policy class. As long as the value $\varepsilon$ does not change, and with probability $1 - \varepsilon$, we choose greedy action with respect to the $Q$ values, we are still "on-policy."
Furthermore, in this article, the author stated that:
On-policy algorithms can only utilize experience replay when the behavior policy is static.
From my point of view, a static policy is one that does not change with time. However, it does not change with time; we cannot update it, can we? Can we use the experience replay with SARSA when the policies are different per iteration?