As already mentioned, max tire width depends on frame clearance and internal rim width. But I’ve also run into a bit of a wildcard from time to time. Different brands (and sometimes models within a brand) measure inconsistently. For example, my current tires. My front WTB Velociraptor 2.3 is wider than my rear WTB Trail Boss 2.4. Both of those are wider than a Maxxis Ardent 2.4 I tried, but the Kenda Nevegal 2.35’s I used to use were the widest of all of these tires. Go figure…
First I would want to know the internal width of the bikes rims. A 2.8in tire needs a minumum (i=inner width) i30mm rim. A 2.6 tire needs a minumum i25 rim. A 2.4 tire needs a minumum i20 rim. Most modern Trail/Enduro bikes come with i30 or wider rims. Most modern XC bikes come with i25 rims. If your bike is more than a few years old the rims could be quite narrow, maybe i20 or less.
Most modern 650b Boosted(110mm hub) suspension forks have clearance for 3.0 tires. With an older 650b non-Boosted(100mm hub) suspension fork, you might only have clearance for a 2.4 tire but some will fit 2.6.
The frame clearance on the rear is not likely to be wide enough for 2.8 tires unless the bike was designed as a Plusbike. If the bike has Boosted 148mm rear hubs, then a 2.6 tire might fit but is not certain. If the bike has older non-Boosted 135mm rear hubs, then a 2.4 or narrower tire is all that will likely fit.
I’m guessing, you could take your bike into your local bike shop and the mechanic could eyeball your bike and tell you exactly what tire widths will work. I suspect that bike mechanics get asked this question frequently.
It is perfectly fine to put a wider tire on the front with a narrower tire on the rear, like 2.8 front/2.6 rear or 2.6 front/2.5 rear. My son’s older non-Boost XC hardtail has 2.6 front/2.35 rear tires on i25 rims (which are the widest tires the bike will fit) and it works quite well.
I’m always in favor of using the widest tires that your rims, frame, and fork will allow up to 2.8 tires. I would not recommend any tire wider than 2.8 and any rim wider than i35. In my opinion, all Trail/Enduro bikes should come with 2.6-2.8 tires on i30-35 rims. That wheel size range is the Trail/Enduro bike sweet spot. The advantages of wider tires (traction, flotation, roll-over, lower tire pressures, and cushion/tire suspension) are absolutely worth the disadvantages (increased weight). Bikes with wider tires are just more fun to ride.