How to find the highest and lowest oxidation state of transitional metal

My teacher taught me the formulas 'nS' and 'nS+(n-1)d' to find the highest and lowest oxidation state of transition elements. He gave the example of $\ce{Mn}$ and showed that the numbers were +2 and +7. But I did not understand it. So can please you give me
a good explanation.


