This is a big ask.
I’m going back to a language analogy because that’s best here.
A bass line is like learning a phrase from a language phrase book. It’s usually more simple, direct and repetitive.
What you’re hearing the player do after 1:17 is conversational. Something with slang thrown in, some dialect, and something that is happening very fast.
It’s a native speaker speaking comfortably in their first language.
So… in order to be able to this comfortably on your bass you have to achieve bass fluency.
Improvising (freestyle) on bass takes a lot of experience and confidence.
What @Al1885 suggeted is a good idea, but even if you do that, you’re still in the “learn and repeat” part of learning, and so you’d still be stuck freestyling on this song and this song alone.
To get to the point where you feel you can make up your own embellishments in any situation, you have two choices.
The fluency through immersion track, or the fluency through classes/knowledge track.
The immersion track is where you just play bass constantly and eternally and learn every bass line you hear, and you’ll start to discover how these things work, and what patterns work where and you’ll play gigs, and people will show you things, and you’ll take a lesson or two or three, and in a year or two, you’ll start feeling more comfortable improvising.
Just takes constant time - constant immersion in bass and music.
This isn’t usually something that people who are past middle school / high school / college can find time for, unless they’re already doing music as a lifestyle.
So then - classes.
Taking lessons and classes when you can.
Having a teacher or course prescribe what patterns to learn when, and how to apply them.
Learning scales, learning to read charts, learning what notes go best with what chords, etc. and trying to maximize the benefits of the time you can spend on the bass.
A combination of these two would be ideal - something where you have a teacher or course, this forum to bounce questions off of, and - ideally - a place to go out and play so that you can test / practice all these ideas and techniques in the real world.
Improvising music - as with language - is the hardest thing to do well.
It’s very doable, and you can find some real cool beginning steps in Josh’s videos. This one has some cool tips that aim at what you’re talking about:
But as far as being in control and feeling comfortable playing improvisations in any scenario - it just takes lots of experience and time on the instrument.