A version of this article first appeared in CNBC’s Inside Wealth newsletter with Robert Frank, a weekly guide to the high-net-worth investor and consumer. Sign up to receive future editions, straight to your inbox.

The ranks of the world’s ultra-wealthy continue to swell, with the number of individuals worth at least $30 million surging to 510,810 at the end of June, up 5.4% since the beginning of the year, according to a new report by wealth intelligence firm Altrata.

Millennials and members of Generation Z only make up 8% of this class, which boasts combined net worth of $59.8 trillion, per Altrata. Baby boomers command the lion’s share of nearly 45% and people born in 1945 or earlier represent another 22%.

However, this dynamic is set to change rapidly thanks to the great wealth transfer, with Altrata estimating that the millennials and Gen Z constituents will make up more than a third of the ultra-wealthy population by 2040. Meanwhile, the share held by baby boomers and the silent generation will shrink from more than two-thirds to a fifth, and Generation X will take the lead with 45%.

This generational shift has far-reaching implications for firms that cater to the ultra-rich, from wealth managers to art dealers as well as nonprofits, according to Altrata’s Maya Imberg.