Use of "Ontological"
Are the Father, the Son and the Holy Spirit ontologically independent
entities, each one being particulars of universal divine attributes?
The word "ontological" is somewhat up for interpretation, so it's difficult to give a clear answer one way or the other without some clarification. With that said, you will find the word "ontological" used in this context. A distinction is made between Trinitarian theologies which posit an Ontological (a.k.a. Immanent) Trinity, versus an Economic Trinity (Lee, 2009). An Ontological Trinity can be found Niceno-Constantinopolitan Creed, which for example states Christ is
Light of Light, very God of very God, begotten, not made,
consubstantial with the Father
The word "consubstantial" here being a translation of the Greek homoousios/ὁμοούσιος. This is almost always considered to be an ontological statement about Christ's being, or substance, or something along those lines. For example, the English Language Liturgical Consultation renders this "of one Being with the Father". Murray, 1966 does not hesitate to refer to the Nicene creed's approach as "ontological".
Blumell, 2014 writes on p. 197:
the primary focus of
the [First Nicene] council had to do with delineating the proper ontological relationship between
the Father and the Son as it pertained to the Son’s divinity. More specifically, the
council sought to articulate exactly how Jesus ought to be considered divine and,
as such, how he ought to be viewed in relation to the Father.
and on p. 205:
To stress the ontological uniformity of Jesus and the Father the term homoousios (Grk. ὁμοούσιος; Lat. consubstantialis), commonly translated as “same substance” or “consubstantial,” was incorporated into the creed.
Bear in mind that this kind of philosophical terminology unfortunately has a tendency to be a bit nebulous and subject to semantic drift. But it's fairly well-established that these terms of subtance, essence, being, etc. are ontological in character.
The Athanasian Creed, which you mention, is full of statements which can be taken to be ontological, e.g.:
And the catholic faith is this: that we worship one God in Trinity, and Trinity in Unity; neither confounding the Persons, nor dividing the Essence.
In short, Nicene Christianity would almost certainly not hesitate to answer that the Father the Son and the Holy Spirit are not ontologically independent entities, but a single Godhead-entity. In Western Christianity, even more-so in light of the doctrine of Divine Simplicity.
If so, wouldn't that mean 3 Gods instead of 1 God? Or should we
understand God as one entity comprised of 3 "sub-entities"?
Yes, I think you're right to say that if the three persons were ontologically independent, then it would be difficult to avoid the charge of polytheism (since separate ontologies implies that they are separate Gods). That's why Nicene Christianity would rather affirm the ontological unity of the three persons.
As for understanding God as having "sub-entities", that is probably misleading, since it would suggest a divided Trinity. For example, the Fourth Lateran (Roman Catholic) Council taught (On the error of Abbot Joachim):
But it cannot be said that He (the Father) has given a part of His
substance to Him (the Son), and retained a part for Himself, since the
substance of the Father is indivisible, namely, simple.
... the Father and the Son have the same substance, and so this same reality is the Father and the Son and also the Holy Spirit proceeding from both.
The three trinitarian persons under the Nicene view are each fully God, and do not separately need to "come together" to achieve full divinity. God is one entity/being, in three persons. Language of "person" rather than "sub-entity" is the distinction here: "sub-entity" implying some kind of allocation of parts of the greater entity to the smaller parts (which would be contrary to Nicene theology), whereas "person" emphasizing relationships and mutual-Love, etc.
But what does it mean to "be God"?
But then what would it mean that "the Father is God", "the Son is
God", "the Holy Spirit is God"? What does it mean ontologically that
"X is God" according to Trinitarianism?
Trinitarianism is not a monolith, but generally speaking, Nicene Christianity would allow "X is God" to be crudely equivalent to "X is God in substance/being/essence/etc."
I suppose the critical question is how one can say "X is God" and also "Y is God" but not "X is Y". Put in other terms, how can multiple persons each be God, without "confounding the Persons, nor dividing the Essence"? But that is not a question of philosophical coherence, but the statement of a mystery.
Is "Lord" being used here as an entity, as a predicate over entities,
Lord is a personal title, which arguably means it only makes sense when applied to persons. A chair is not a person (at least, not without a very unusual idea of personhood), so it wouldn't make any sense to say "This chair is my Lord". Regardless of what you think about that argument, Trinitarianism certainly holds that "the Father", "the Son", and "the Holy Spirit" refer to persons, so the predicate is plainly over persons in this case.
Usually, there is only one person per entity. Trinitarianism supposes an exception for God.
What is a formal ontological definition of the nature of God according
to the doctrine of the Trinity?
Expecting an explicit "definition" from official sources is probably too much, although the Athanasian creed is close. Succinctly, God is a single being ontologically, but at the same time, three persons. Each person does not have a separate ontology but shares the one Godhead-ontology.
Lee, S. G. (2009). The Relationship between the Ontological Trinity and the Economic Trinity, Journal of Reformed Theology, 3(1), 90-107. DOI: https://doi.org/10.1163/156973109X403741 Download: https://www.researchgate.net/publication/233714991_The_Relationship_between_the_Ontological_Trinity_and_the_Economic_Trinity
Murray, J. C. (1966). The Status of the Nicene Creed as Dogma., Chicago Studies: An Archdiocesan Review, 5. Text: https://www.library.georgetown.edu/woodstock/murray/1966j#2
Blumell, L. H. (2014). Rereading the Council of Nicaea and
Its Creed. Published in Standing Apart: Mormon Historical Consciousness
and the Concept of Apostasy, Oxford University Press, pp. 196-217.