YouTube videos are for free online, and it's legal to make them MP4 and keep them on your smartphone. What is not legal would be to reproduce these MP4 files without explicit permission from the author. That's why you need to be very careful about the way of storing MP4 and what is going to happen with them after you download them.