Using a graphics app such as Adobe Illustrator, Sketch, Adobe XD, Inkscape (free), etc.
Photoshop only exports proper SVG from native vectors. Vector smart objects don’t export as SVG properly, they end up having an embedded PNG in them instead of vectors!