"It" does not refer to anything; it is an impersonal pronoun that is required by the syntax but does not have any real meaning. It is basically the same "it" as in "It's ten o'clock."
By "the science", the narrator means science in general, which for him apparently includes both "natural philosophy" and alchemy. It is not obvious why he would write "the science" instead of simply "science", unless the addition of the definite article is intended to reflect German usage, according to which the article is required ("die Wissenschaft" = science).
The quest for immortality or the prolongation of life had been part of Chinese alchemy, Indian alchemy and Medieval European alchemy. The narrator is more interested in this type of quest than in natural philosophy that professor Krempe expects him to study.
The German theologian, physician and alchemist Johann Conrad Dippel (1673 – 1734), who was born at Frankenstein Castle and may have been a source of inspiration for Mary Shelley, also attempted to created an "elixir of life".
Update in response to comments by Apollyon:
"It" does not appear to refer to "modern natural philosophy": the passage contrast contemporary trends in science ("natural philosophy", chemistry) with the older and outdated alchemy. The "difference" is the shift from alchemy to more modern ideas, which includes the abandonment of the search for elixirs and treatments that promise eternal life. For this reason "the science" in "the masters of the science" either refers to science in general (as stated above) or it refers to alchemy because the narrator is (linguistically) getting his reference wrong.