This will all depend on whether AA tags your bags to JFK or to SFO. If the former, you will not be able to check them at JFK until the next morning. If the bags are tagged to SFO, you will be able to simply drop them with the AA bag drop post-CBP at JFK. As a rule, AA should refuse to tag the bags with an overnight connection, but you may be able to convince LHR staff to do so. You cannot count on the latter and won't know until check-in whether it will happen as the official answer is "no".