Earlier this year, I was flying JFK-LHR-BOM with LHR-BOM on BA. I was on a gifted SWU from JFK-LHR so credited that leg to AA. At LHR, I had to collect my BP and asked the transit agent to change LHR-BOM to BAEC and it showed correctly on BP. I then went to First Lounge where I was asked(correctly) to show my Emerald Card as the BP showed Sapphire(BA). LHR-BOM credited to AA in the end (and I got a ridiculous 638 AA miles for that - with the bonus).
I have a similar trip coming up and both JFK-LHR/LHR-JFK legs have cleared SWU already for next month. I wish I can change to BAEC as the ticket was really cheap using Citi TYP