Horizontal alignment for lyrics can be set by overriding the self-alignment-X property of the LyricText object. Value  -1 means left-aligned, 0 centered, and 1 right-aligned. Alternatively, you can use the Scheme values LEFT, CENTER, and RIGHT instead of numbers.

\version "2.24"

\layout {
  ragged-right = ##f
}

\relative c'' {
  c1
  c1
  c1
}
\addlyrics {
  \once \override LyricText.self-alignment-X = #LEFT
  "This is left-aligned"
  \once \override LyricText.self-alignment-X = #CENTER
  "This is centered"
  \once \override LyricText.self-alignment-X = 1
  "This is right-aligned"
}