Try starting with a 3 note per string major scale such as Figure A. Pick the first note on each string and hammer-on the second and third notes. Naturally this works well as triplets, thanks to the 3 notes on each string.
The next step is to play the scale as quavers (Figure B). As a starting point, try and get all notes in the scale to sound at the same volume. This can be trickier than it seems, especially with the first note on each string being picked and then the varying levels of strength in your other fretting fingers controlling the rest of the dynamics.
From there, move on to Figure C, which accents beats 1 and 3 of each bar. You’ll quickly notice that these accents fall on different fingers on each string. Balancing the picked dynamics and volume with the legato sections are the key to getting an even sound. Try softening your attack with the picked notes or go one step further and try using your second finger, à la Tom Quayle.
Figure D jumps up a little in difficulty. Start slowly, focussing on balancing the volume of the picked notes and hammer-ons and then gradually increase the tempo once you’re feeling comfortable. Adding some gain to your tone can be fun for increased sustain, but don’t overlook practicing them clean as well – distortion can often hide sloppy technique. Experiment with other scales and modes and remember they don’t have to be limited to 3 notes per string. With practice, you’ll get used to different fingerings and hopefully in time be able to incorporate various shapes and patterns all over the neck at will.
Finally, don’t overlook your picking technique. Whilst legato lines can sound great and be fun to work on, you still need good control of the pick for with these exercises (and in general for improvising, rhythm playing and loads more). Create your own licks, try it all over the fretboard and in various styles. For more ideas, check out Michael Dolce, Frank Gambale and Tom Quayle.