If you want the library to be able to take a pointer to a HardwareSerial or SoftwareSerial you can change the library to use a "pointer to Stream". Then you can take your serial object (Serial, Serial1, mySerial, etc.) and pass it to the library. Since HardwareSerial and SoftwareSerial both derive from Stream the library can use the pointer without knowing which kind of "Stream" it is.