I just did this for you quickly… back up your mesh beforehand to avoid your original getting modified.
Add these scripts to your project:

MeshRotator.cs
using UnityEngine;
public class MeshRotator : MonoBehaviour
{
public MeshFilter meshFilter;
public void ApplyRotationToVertices()
{
Mesh mesh = meshFilter.sharedMesh;
Vector3[] vertices = mesh.vertices;
for (int v = 0; v < vertices.Length; v++) vertices[v] = meshFilter.transform.TransformPoint(vertices[v]);
meshFilter.transform.rotation = Quaternion.identity;
for (int v = 0; v < vertices.Length; v++) vertices[v] = meshFilter.transform.InverseTransformPoint(vertices[v]);
meshFilter.sharedMesh.vertices = vertices;
meshFilter.sharedMesh.RecalculateBounds();
}
}
Editor/MeshRotatorInspector.cs
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(MeshRotator), true, isFallback = true)]
public class MeshRotatorInspector : Editor
{
private string exportTo = "Assets/rotatedMesh";
public override void OnInspectorGUI()
{
if (target.GetType() == typeof(MeshRotator))
{
MeshRotator mr = (MeshRotator)target;
if (GUILayout.Button("Apply Rotation To Vertices")) mr.ApplyRotationToVertices();
GUILayout.BeginHorizontal();
exportTo = GUILayout.TextField(exportTo);
if (GUILayout.Button("Export Mesh"))
{
string path = exportTo + ".asset";
Mesh mesh = AssetDatabase.LoadAssetAtPath<Mesh>(path);
if (mesh != null)
{
Debug.Log("file already exists");
return;
}
mesh = Instantiate<Mesh>(mr.meshFilter.sharedMesh);
AssetDatabase.CreateAsset(mesh, exportTo + ".asset");
mr.meshFilter.sharedMesh = mesh;
EditorGUIUtility.PingObject(mr.meshFilter.sharedMesh);
EditorUtility.SetDirty(mr.meshFilter);
}
GUILayout.EndHorizontal();
}
base.OnInspectorGUI();
}
}
Then create an empty GameObject, add the component.
Then add a child GameObject to it with your Mesh in a MeshFilter (and add a MeshRenderer to that so you can see it in the scene).

Rotate the child with the mesh to however you want the vertices to be.
Drag the child to the Mesh Filter slot on the MeshRotator.
Click “Apply Rotation To Vertices”.

This will apply the rotation of the child to the vertices and set the rotation of the object back to 0,0,0.
Click “Export Mesh” to save the rotated mesh to the indicated path. You could easily extend this with scaling if you wanted to scale vertices to the object’s scale in a similar way.
Edit: All you have to do for this to work for everything (not just rotation but also for scaling mesh vertices or offsetting the origin), to “transfer” that from the Transform to the vertices, where it says
meshFilter.transform.rotation = Quaternion.identity;
, replace that with this:
meshFilter.transform.localRotation = Quaternion.identity;
meshFilter.transform.localScale = Vector3.one;
meshFilter.transform.localPosition = Vector3.zero;
It’s not everything you’re after and it’s just quick for illustration, but hopefully the above helps you work out an automated solution.