Do I need to have the same transceiver in my tester and the router I'm connected to?

You don't need to have the same type of transceiver as long as they both support the same Ethernet interface.

There is no requirement to have matching transceiver types between the device under test (DUT) and the test equipment that you are using to test.

Ethernet specifications define many different types of PHY (the physical interface)

Some of these interfaces are optical (eg. 1000Base-LX) and some will be electrical (eg. 10Base-T), however as long as the two interfaces are matching then you can interconnect them regardless of transceiver form factor.

S0 for example a 10G Base-SR connection could have an XFP transceiver at one end and an SFP+ transceiver at the other end as long as they both supported the 10G Base-SR standard.