You will need a computer with a GPU that has at least two outputs.
The first one, connect to your monitor as usual.
The second, connect to the capture device.
In OBS, go into Studio mode, right click the Program monitor (the one on the right side) and open a Projector. From the pull-down menu, choose to send the output of that projector to the HDMI port that is plugged into the Uray.
If your program has audio, then you'll also need to set audio monitoring to go to that HDMI port (assuming your GPU supports this feature, otherwise you've got another issue). Also in this configuration, you may get audio desync, as OBS is not expecting this kind of configuration, and its audio monitoring is input monitoring, not output monitoring.
Bottom line: OBS is not intended for use with external encoders. You can use them, but there are issues that will mean you won't necessarily be able to use OBS in the way you would think, and there are technical limitations that may cause certain problems (like audio desync).
OBS does not have a simple option that says "use this hardware encoder I have plugged in, but otherwise behave as normal". If you want to use a hardware encoder with OBS that has high performance and convenience, currently the best available for the price is an Nvidia 1660 card, but you would only be able to use that in Windows, not in MacOS.