You can transfer miles but the limit is transfers and purchases so if you have bought 40000 miles then no go.And AA charges for transferring so really not a good option.
Buy and gift:
"buyAAmiles and giftAAmiles transactions are limited to a combined maximum of 40,000 miles, per account, per calendar year."
Share:
"For a limited time, members can transfer and receive up to 25,000 miles per transaction and up to 100,000 per account, per calendar year. "
Sharing miles does not count toward the same annual limit as buy/gift.
So yup, you can buy, then on top of that do a transfer from someone else's (eg, partner or family member) account, to get more than 40k (before the bonus) into your account annually.