This can be done using the Join CD Tracks option when ripping a CD. The Join CD Tracks option only appears if the CD is sorted on the left-most column of numbers in ascending order and two or more consecutive tracks are selected.
Note it must actually be that left column, not track number or album by artist, or another column which could give the same order, but not enable the option.
There is no option in iTunes or Music to merge two tracks that have already been imported to the library, although assigning the same value to the Grouping field and then shuffling by groups should ensure they play consecutively even when you're shuffling.
Third party tools can be used to merge or split tracks provided they don't contain DRM, which tracks from the Apple Music subscription service would do.
tt2