The buttons you want to remap are the Forward Button and the Back Button. Before remapping them, the buttons need to be diverted. "Diversion" here means that the buttons are passed through Solaar, so that when you press them, Solaar processes the input and provides the relevant action.
To divert the Forward Button and the Back Button:
Open Solaar.
Select your mouse on the left pane.
Click the lock that corresponds to the Key/Button Diversion item on the main interface until it is shown as unlocked.
Click the left drop down of the Key/Button Diversion item and select Forward Button, then click the right drop down of the Key/Button Diversion item and select Diverted (see screenshot):

Repeat the previous step for the Back Button.
Now that the buttons are diverted, you can add your custom rules. To do that:
Click Rule Editor on the bottom right of the program's main window.
Using the right-click options, add the User-defined rules shown in the following screenshot:

Alternatively, you can copy the rules below and paste them in the ~/.config/solaar/rules.yaml file (create the file if it doesn't exist already):
%YAML 1.3
---
- Key: [Forward Button, pressed]
- KeyPress:
- [Control_L, Tab]
- click
...
---
- Key: [Back Button, pressed]
- KeyPress:
- [Control_L, Shift_L, Tab]
- click
...
Note: Make sure to keep a backup of the file you already have. You don't want to lose your current configuration. If the above work as intended, then you can append them to your current configuration.
That should be it! You should now be able to use the Forward Button of your mouse as Ctrl+Tab and the Back Button of your mouse as Ctrl+Shift+Tab.
PS: Since you are using Wayland, you also need to have the Solaar extension installed. Make sure to install it, if you haven't already.
If for any reason the above don't work, make sure to also test them in an X11 session.