A battery energy storage system (BESS), due to its very fast dynamic response, plays an essential role in improving the transient frequency stability of a grid. The performance of the BESS varies with the system's installation site. Hence, the optimal location of the BESS is of utmost importance for improving transient frequency stability. Therefore, this paper presents a hierarchical approach for optimizing the BESS placement to improve a grid's transient frequency stability. In most research, frequency nadir and rate of change of frequency (ROCOF) have been considered for studying frequency stability. This paper considers two more parameters, along with frequency nadir and ROCOF, to study the transient frequency stability, settling time, and decay ratio. A novel frequency stability index (FSI) using the four transient frequency parameters has been developed. After a significant disturbance in a benchmarked test system, the FSI was used to identify the optimal location of the BESS for stabilizing the frequency. It has been observed that, after a sudden generator outage, the ROCOF and the frequency nadir improve the best when the BESS is located at the bus closest to the generator experiencing the outage. However, considering the other two parameters as well, the value of the FSI is the minimum; that is, the optimum solution is when the BESS is located at the bus that is the second closest to the generator experiencing the outage. Results of similar studies validate the proposed FSI in indicating the optimal location of the BESS in improving the transient frequency behavior of the system.