Nissan Frontier

5 speed. Won’t stay in first. What can I expect a mechanic to do?

Tear the transmission apart. Depending on the year and mileage this may involve a complete rebuild. The problem is more than likely a worn synchronizer hub/sleeve/insert assembly and/or a worn 1/2 shift fork.
Since I assume the truck is a late model with comparatively low miles the problem could be caused by doing a lot of slow speed 1/2 gear driving with a hand resting on the gearshift or shifting into 1st gear a lot at an excessive speed.