The phone has tap to wake (iphone 8 doesn't)... so contact with your skin through your pants pocket is making it think you're trying to wake the phone. Hence me telling you to put the phone in your pocket facing out or getting a sleeve for your phone so there is a thicker barrier between the screen and your leg. Apparently your pants pocket material isn't thick enough to prevent inadvertent touches.
Solved for me. Mine was pocket dialing emergency contacts. Look for “Emergency SOS” in settings.