I want to measure the voltage drop across the resistor RS1. The opamp is powered by a 5V supply rail. The 50VDC is coming from the same supply source but its isolated using a step up transformer and rectifier circuit. Now, the question is, where should the ground pin of the op-amp be connected? is it safe to connect it to the ground of the +50VDC rail or can I just connect to the battery ground(5v power rail source) which is isolated from the 50VDC rail
It is OK to use an isolated transformer to boost a signal to 50V and measure its effective output dependant on the load.
This Load regulation of source voltage depends on the impedance ratio as your step-up voltage, impedance also steps up by the ratio squared.
However, if you know the range of loads to this secondary voltage that you expect, you can choose high resistance values and attenuate x0.1 to the 0 to 5V range while increasing the input range with gain and offset for sensitivity. e.g. If you want to measure the output with more gain using a range from say 45 to 50 you can use a 4.5V reference instead of the 0V for inverting gain but use the non-inverting input so that the gain and attenuation match to give overall unity gain.
Then the gain of Vo/Vi= (50-45)/(5-0)= 1 but the apparent offset is the average of 45 to 50V.
Then using this hypothetical example you get this clever example. You may choose something different for design specs for gain, offset and isolation or leakage current. Depending on your application use of ground currents you may want something to reduce common mode rejection ratio or CM gain.