This document is the only description of KiCad file formats I know.
https://dev-docs.kicad.org/en/file-formats/legacy_file_format_documentation.pdf
But why are you interested in it?
In older KiCad versions it was relatively common to edit files directly because of missing functionality in KiCad, but that was years ago. Sometimes it is still convenient to hack into those files, for example for bulk search & replace, but in KiCad V5.1.x you can do al regular library maintenance from within the GUI and with a few mouse clicks.
A short peek at the LM338T datasheet suggests that you can just use it as an alias of the LM317. Or (if I missed something) you can always simply make a copy of the LM338
7 schematic symbol as a starting point, modify it for the LM338 and save it in a custom library.
I do not have much experience with external libraries, because I find KiCad’s own libraries of better quality. The editors for Schematic Symbols and Footprint are also quite good in KiCad. So I do not even bother to go to sites like snapeda, but just make the parts myself if needed.
Schematic symbols are usually fairly simple Just a rectangle with some pins.
And regardless of whether you want to create your own parts, or get them from an external source, you should know how to manage libraries in KiCad.