What are the mechanisms a civilian Government use to control the Military power?
The Second Amendment to the US Constitution or its equivalent.
Consistent with the Constitution, US federal code specifies that "The militia of the United States consists of all able-bodied males" of certain ages eligible for conscription, although nothing rightly prohibits any other non-felon citizen from keeping arms "for the security of a free state" as the Amendment declares.
In other words, the people of the nation--its private citizens--are the military.
How/When did the rule of the society moved from a military government
to a civilian government?
All you have to do is wait for the next war, and you will see that there can be no such sustainable thing as a pure civilian government with no military. Or you can observe the capitulation of countries historically that lacked sufficient military strength to contend with invaders or internal revolutions. Either will be a sufficient proof of the absurdity of government not defended by a sufficiently strong military.
Do Armies have internal protocols to intervene a Government if they consider that Government represent a threat to the country?
Yes, in the USA at least. The Oath of Citizenship requires each prospective citizen to make and keep the following oath: "I will support and defend the Constitution and laws of the United States of America against all enemies, foreign and domestic". It goes on to mention the bearing of arms and combatant and noncombatant service consistent with this pledge as specific conditions of citizenship. In the US, every citizen is meant to be insurance against a rogue government or military force. In any country that upholds a similar standard with a popular base, expect a similar result.
Military power isn't worth a hill of beans without the economic infrastructure necessary to support it. This is why every country that ever embraced Socialism has collapsed or is now collapsing. It saps the people of their ability to resist tyranny. A monopoly on the economy need not even be obtained from the start, only a controlling influence. Some flavors of Socialism or Communism promise the populace that they can keep the means of production while the government redistributes the product, while others promise private rights to the fruits of labor while subsuming the "means of production". Both are a lie. Economies consist of production-consumption cycles. Control half, and you control the whole thing. Gun confiscation typically follows economic dependence.
The Army could easily seize control of a country and the power of the
Executive, Judicial and Legislative branches is only in paper.
As long as the Second Amendment (or its equivalent) is upheld, checks and balances and the separation of powers are backed by the real power of cold steel in the hands of thinking and independent citizens who have made an oath to uphold justice, not just on parchment.