In middle school, we often do transformation like this:
$a+b=c$
$a=c-b$
I think the variables $a,b,c$ are mapped into variables in FOL, the $+,-$ are mapped into function symbols of FOL, and = is the equation symbol in FOL. But what about the transformation from 1 to 2? There is no such deduction rule in FOL.
Is there any book/material talking about algebra in middle school in FOL in detail?
"There is no such deduction rule in FOL."
True. And there shouldn't be one.
Why?
Because FOL aims to regiment "topic-neutral" patterns of reasoning, whose validity turns on the way propositional connectives and quantifiers are used in the premisses and conclusion.
And the inference involved in going from (1) to (2) -- while correct, of course -- is not of that topic-neutral logical kind, but depends on the very particular meanings of the arithmetical functions "+" and "$-$". It's arithmetical reasoning, not topic-neutral pure logical reasoning.
But yes, if we want to, we can regiment middle-school arithmetic (and more!) in a first-order language with some arithmetical axioms and FOL as our deductive apparatus.
And then, if we have set things up right, we can get from (1) plus the axioms of your arithmetic to the conclusion (2) by FOL. But you can't get from (1) to (2) by FOL alone!
If you want a flavour of how to set up a formal axiomatic theory of arithmetic using FOL as its deductive apparatus, check out "First Order Peano arithmetic" (though this only goes as far as the arithmetic of the addition and multiplication of non-negative numbers). E.g. have a look at Chapters 6 and 7 of my https://www.logicmatters.net/resources/pdfs/GWT2edn.pdf