Start by checking to see if the cassette joint is installed properly. Go to the
Alfine page on si.shimano.com. Open the Dealer manual (the red 'DM' icon) and check how to properly install/adjust the hub hardware. Depending on the series of hub, the distance between the end of the housing and the cable anchor is either 101mm (500 series) or 145mm (7000 series). All the other information is still pertinent, it is just far easier to read in the complete dealer manual than the individual documents. This would also be a good time to pull the ferrules off the housing, checking for uneven/protruding housing ends, check the cable for kinks, etc, as IGHs are finicky about cable tension.
Assume the previous owner did nothing right, as far as maintenance/setup, etc...
If you are getting consistent slips, it may already be too late to fix the hub, but if after you try the above, it still continues, you will have to open the hub to check on it. If it is used, you should be opening it to clean/lubricate it anyway, as small shavings of metal do occasionally come off and cause poor operation.
The
hubstripping wordpress is a good place to start for collected information, but some articles may require you to either read German/use a translating feature.