Hi OP, the steps would be:
Neighbour to agree to this and you both to agree to a sale price and what you want to do about her legal costs. She might not use it but her family may not be keen on her selling it off (if she's asking them). If the neighbour has a mortgage, her mortgage company will need to consent and to release the charge against that part of the title.
If that's a green light, speak to the freeholder and ask for consent. You'll have to pay their fees too (on the basis that they'd have no costs if you didn't want to do this).
If that's OK, the upstairs lease needs to be changed by a deed of variation to remove the garden from the demise (this is the description of what land/buildings are included in the leasehold title). A plan of the garden will need to be prepared by a surveyor as it will need to meet Land Registry rules.
At the same time, you need to be given a supplemental lease of the garden by the housing association. It's theoretically possible for the neighbour to assign the garden to you but leases usually don't allow parts to be sold off sideways rather than up and down if that makes sense?
You'd also need to check there are no planning provisions which would stop this being done though if it's passing from one flat to another, that's probably unlikely.
Both transactions need to be completed simultaneously .
All the changes need to be registered at the Land Registry.
Doable of course but those are the steps and the various fees that you'd have to pay for in practice.