struct FMeshData {
	TArray<FVector> Verts = {};
	TArray<int32> Tris = {};
	TArray<FVector> Normals = {};
	TArray<FVector2D> UVs = {};
	TArray<FLinearColor> Colors = {};
	TArray<int32> Sects = {};
	int32 NumSections = 0;
	FVector Min = FVector(0.0f,0.0f,0.0f);
	FVector Max = FVector(0.0f,0.0f,0.0f);
	FVector Bounds = FVector(0.0f,0.0f,0.0f);
	FVector Center = FVector(0.0f,0.0f,0.0f);
	float Radius = 0.0f;		
}

Sections are stored in Sects array which is per vertex. Verts may not be in contiguous sections, so the Mesh Data may need to be sorted beforehand.
Adapt this code:

UStaticMesh* mesh = NewObject<UStaticMesh>(GetTransientPackage(), MeshName);
//some code here
FStaticMeshLODResources& LODResources = mesh->GetRenderData()->LODResources[0];
LODResources.Sections.SetNum(Data.NumSections > 0 ? Data.NumSections : 1);
    for (int32 SectionIndex = 0; SectionIndex < LODResources.Sections.Num(); ++SectionIndex) {
        FStaticMeshSection& Section = LODResources.Sections[SectionIndex];
        Section.MaterialIndex = SectionIndex;
        Section.FirstIndex = ???;
        Section.MinVertexIndex = ???;
        Section.MinVertexIndex = ???;
        Section.NumTriangles = ???;
    } There should be exactly 2 paragraphs separated by the markdown divider: ***.
user