It can be done either way. I made a grill once that the legs were separate and fit into holes on the bottom of the grill. The camp chef camping burners use this same idea. Benefit is legs can be easily replaced or adjusted in length. Drawback is it typically takes 2 people to assemble.
You could easily do the folding legs like in your picture as well. They tend to make the whole assembly a bit more bulky and heavier but, if light enough, can be stood up by one person.
I would look at some of the commercial grills out there for ideas.
And welcome to the group.....