EWR-BOS is a domestic flight so it has bugger all to do with visas. Once you're in the country, you're in the country. The only thing they care about then is that you don't overstay your welcome.
Only the jobsworths at the border care about your visa, so in your case, the official you meet when you step off your LHR-EWR flight, the one who treats you like a criminal and takes your photograph and fingerprints.
But I've never done a direct connection in the US, so I'm happy to be proven wrong. One thing you might want to check is that you are actually connecting and not flying in, picking up your bags, and checking in again. I suspect the US may demand in the name of secuwwwity that the latter happens. In which case, the point of immigration will be very clear to you.