Official comment
If the controller or mixer you're using puts the lighting into EXTERNAL mode (because it's an external-mode audio device), you can follow the instructions here for a Mac (if you have a PC, you'll need to use a different app - MIDIkey2key does the same thing):
First, on the XZ, open the UTILITY menu and scroll down to MIXER MIDI MESSAGE and set it to SEND.
Next, you'll need midiStroke, so grab that and install it. When you go to launch it the first time, right click and select Open, otherwise you'll get a warning and it will ask if you want to send it to the trash. Once it's running, open System Preferences > Security & Privacy > Accessibility, then unlock the panel (if necessary) and then click the + below the program list and add midiStroke. This is to give it permission to generate keyboard input.
Continuing on... open rekordbox and go into the preferences to Keyboard and expand the Lighting section. Add shortcuts for Deck Select/Deck 1 and Deck Select/Deck 2. I set mine as Command+Option+Shift+1 and 2; shortcuts which would not be used by any other application. Close the rekordbox preferences and go back to midiStroke.
On the left side of the window, click the + icon and enter the values:
num - 11
chn - 5
val - 0
On the right side of the window, click the + icon and change the Z to a 1, then tick the boxes for the Apple icon, the alt icon, and ctrl.
Back on the left side of the window again, click the + icon and enter the values:
num - 11
chn - 5
val - 127
On the right side of the window, click the + icon and change the Z to a 2, then tick the boxes for the Apple icon, the alt icon, and ctrl.
At the bottom of the window, click to change the source from None to XDJ-XZ (2)
Now leave midiStroke running and switch back over to rekordbox.
Moving the crossfader on the XZ to the very end of the travel will now result in the lighting channel selection changing automatically.
Note: If you are using another product, the MIDI input will be different. Please use a MIDI monitor app to determine which input number is required for your crossfader.