For problems like this you often start off by building the XSLT identity template
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
On its own this copies all nodes as-is, which means you only need to write matching templates for nodes you wish to transform.
To start with, you wish to add the num attribute to the product, so have a template matching product where you simply output it with the attribute and continue processing its children.
<xsl:template match="product">
<product num="{position()}">
<xsl:apply-templates select="@*|node()"/>
</product>
</xsl:template>
Do note the use of Attribute Value Templates here in creating the num attribute. The curly braces indicate an expression to be evaluated, not output literally.
Then, you want a template to match the children of the product elements, and turn these into attribute nodes. This is done with a pattern to match any such child, like so
<xsl:template match="product/*">
<attribute name="{local-name()}">
<xsl:apply-templates />
</attribute>
</xsl:template>
Note that <xsl:apply-templates />
could be replaced with <xsl:value-of select="." />
here if you are only ever going to have text nodes within the child elements.
Try this XSLT
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="product">
<product num="{position()}">
<xsl:apply-templates select="@*|node()"/>
</product>
</xsl:template>
<xsl:template match="product/*">
<attribute name="{local-name()}">
<xsl:apply-templates />
</attribute>
</xsl:template>
</xsl:stylesheet>
When applied to your XML the following is output
<products>
<product num="1">
<attribute name="type">Monitor</attribute>
<attribute name="size">22</attribute>
<attribute name="brand">EIZO</attribute>
</product>
<product num="2">
......
</product>
</products>
Of course, if do actually want to turn the child elements into proper attributes, as opposed to elements named "attribute", you would use the xsl:attribute command. Replace the last template with this
<xsl:template match="product/*">
<xsl:attribute name="{local-name()}">
<xsl:value-of select="." />
</xsl:attribute>
</xsl:template>
When using this template instead, the following is output (Well, it would include product 2 if your sample has child elements for it!)
<products>
<product num="1" type="Monitor" size="22" brand="EIZO"></product>
<product num="2">
......
</product>
</products>