Thanks for your question! I hope things will go well with your new dog and it sounds like she got a great new home.
It is always difficult when you don't know the whole history and can't put vague symptoms like these into context. She may have done this yelping long term or perhaps it is a new problem, but we will never know! Typically when dogs cry out suddenly it is due to pain.
I have a few general ideas of what could be bothering her, but certainly a full vet exam would be ideal, and possibly a "health screen" with routine blood testing or even x-rays if the vet feels it is warranted, just to be sure there are no obvious problems.
I have certainly seen dogs who seemed completely normal otherwise (no other symptoms, no limping, etc.) who occasionally would yelp or act painful. Of course they never do it at the vet's office :). A couple of thoughts would be nerve pain, such as a pinched nerve, which can come/go. This is challenging to actually diagnose but is one thought I would have if there are no other symptoms. An x-ray of the spine could show possible abnormalities which could cause nerve pinching.
A common cause of vagues signs of pain is also back pain. Often these dogs may have other symptoms, such as avoiding stairs or jumping, trembling or shaking, etc. But the vet can palpate the spine, and again an x-ray may provide clues. Back pain can be due to soft tissue (muscular) problems or due to intervertebral disc problems in the spine.
Frankly, in my experience, if all else is normal, exam and testing are normal, it may be hard to find the exact cause of the yelping. If further, more specific signs develop, that would help localize the problem.
I hope this gives you a few ideas. Thanks again for your question! Let me know if I can further assist you. Dr. Marcia